Check to see if your 3700X is overheating or going past 95c to eliminate CPU Cooler issues.
If it isn't overheating when you computer shuts down by itself and you believe it might be incompatible RAM, remove all the RAM Sticks except for one RAM stick in DIMM Slot #2. See if the computer shuts down by itself. The computer will be much slower since it has less RAM installed but it should boot up and work well with a 8 GB Ram Stick.
Also check your Motherboard's QVL List for RAM MEMORY for the 3000 Series Processors and see if your RAM is listed on not. If not then check at Corsair's Website if the RAM is compatible with your Motherboard.
Also check if your GPU card is overheating. That will also cause your computer to shut down by itself.
I would download the free Stress testing OCCT software and run all three tests to see if the computer shuts down during those tests.
While running the CPU and GPU tests check the Temperatures and Fan speeds to make sure it isn't overheating.
For the PSU test, which runs both the CPU & GPU Tests at the same time putting maximum stress on the PSU, check your output voltages from the PSU - 12/5.5/3.0 VDC. Each should be within 5% Tolerances.
A bad PSU can also shut down your computer by itself due to poor power outputs.
If all that checks good then it might be a Driver causing the problem.
NOTE: Do you get any type of error messages before it shuts down by itself like a BSOD? If so please post them.