PC restart and occasionally blue screen

Hoping to get some advice from someone who knows more than me before I start buying replacement parts. My fiancé recently bought a used PC off Facebook marketplace. It came with an AsRock B75M-DGS motherboard, i3-3220, GTX 660, 2x8gb ddr3 1600 ram, and an Antec 450w power supply. Clearly a little underpowered. I replaced the i3 with an i7-3770 and the 660 with a GTX 1060 6gb. Before I bought them I checked if they’d work with the 450w power supply. This is when the issues started. When a game is started there’s a pretty good chance that the PC will immediately restart itself and it has blue screens a few times as well. I have checked event viewer but it doesn’t give a reason for the shutdown. I have tried multiple different drivers for the gpu and also reseated it, the ram, and all connectors off the psu. I downloaded OCCT to test the components. The cpu and gpu seem to be fine under load. The psu also seemed to be okay. When I tested the ram at 90% it gave an error about every 2 seconds. I tested it again at 80% and the pc restarted itself as soon as the test started. I tested it once more at both 80% and 90% and both times it did not restart or throw an error. I’m not really sure what’s causing the issue but I think it’s either the ram or the psu. I should note that it doesn’t crash every time and it will run without an issue. I have also checked the temps and ensured that nothing is overheating. Anyone know how to know for sure what’s causing it without buying new components?