For me it's so strange, I'll be away from the computer all day and it will be up, I'll come back, use it for awhile, maybe play a video in facebook and BAM it freezes, it's so weird.
I had a similar issue with a 6700k and an RX560.
Are you overclocking? (Turn off OC).
Is XMP enabled? (Disable it).
Also you need to realize that your CPU has an iGPU and you need to use 18,3 SMBIOS if you're not already.
You need to enable iGPU in BIOS (something like Multi-Monitor enable) and then set the GPU to "Auto".
Throw in nVidiaGraphicFixup.kext into your efi/other folder along with whatevergreen and lilu before you do any of the above.
You need to get the SMBIOS as close as possible to a real iMac (GPU wise), and the 18,3 has a RX 5xx GPU.
My main workstation is now a Skylake-X (see specs in signature) and I have not had a single lockup like that. So your issue that I had before is definitely iGPU related. You NEED to enable iGPU on consumer CPUs to get 100% stability even if you're not "using" it. For example, FCPX will use the iGPU's Intel QuickSync tech.
After you do all of these, go to System Information and under Graphics/Displays you should see both the RX560 and the iGPU displayed in there. That should lessen or definitely get rid of those freezes. I noticed that a lot of these freezes I had were related to Chrome.
This recent Skylake-X built is the best Hackintosh I've had so far. Feels like a real Mac with no issues.