Mainly happening in Windows?
if so:
Right click My Computer -> Properties -> Advanced -> Startup Options -> UNcheck "Automatically Restart in case of BSOD"
Then when it would have rebooted, it will give you an error instead, which you can fire into google.
If it's just randomly 'turning off' then got another PSU to try?