If your system is powering off (as opposed to getting a blue/black screen of death, which usually indicates a driver fault) then the problem isn't with Baldur's Gate 3, it just happens to have pushed your system hard enough to expose a hardware problem.
First thing to check should be temperatures; install HWInfo or some other tool that lets you monitor temperatures and see how hot your system is getting after a while (you may need to use GPU software to get the GPU temperature). You'll want to double check what your hardware's tolerances are, but in general you don't want a modern CPU going over 90ºC, GPUs can usually handle a bit more, but ideally you want them cooling to below 70ºC if the cooling is doing it's job. But again, check specs for your specific parts as some do just run hotter and that's fine.
If you think your system is getting too hot, then as Beechams says check your system isn't clogged with dust and the fans are running. HWInfo and other monitoring tools can tell you what your fan speeds are like, but unless you only have two fans (one for CPU and one System fan) it probably won't be able to give you speeds for them all, so you need to check air is flowing as expected.
If it's not the temperature, then the next to check would be any overclocking you (or your system provider) might have done; this is much more complicated, but overclocking (and undervolting) can lead to instability that can cause sudden restarts when a CPU/GPU fault occurs as a result. You'd need to check what the default speeds are for your CPU, GPU and RAM so you can compare to what they're reporting as, to see if they've been altered. If something has, try putting it to default and see if that solves the problem; this may require you to poke around in BIOS settings.
Only if none of this helps would I assume a faulty PSU; though in my experience a faulty PSU will usually fail randomly or soon after startup, rather than waiting until you put it under load.