What causes my Macbook to spontaneously shut down?
Your symptoms are either a bad driver / os for the video subsystem or a hardware failure. 

In case of hardware, safe mode will often run since it doesn’t ask as much of the video system which runs in a fail safe / basic mode. Also, it can slow down the rendering so you can easily see the failure modes or grab a screen shot. 

Before paying for a repair, consider charting how often this happens and back up / erase install to be sure this is the hardware / vram failing. 

As to the shutdown, unless there’s a severe failure, you should get. A kernel panic, but if the logs show no events and no panics, then that’s another reason to suspect hardware failure. 

Since your mac won’t run more than 5 minutes in normal mode, why not back it up in safe mode and try an erase install. If your Mac can’t reinstall itself, then you know it’s repair time. If it can, you’ll be back in business