If the problem disappears in Safe Mode, then something you installed is causing the problem. You may have to uninstall apps one by one until the problem disappears. If the problem persists in Safe Mode, then it's more likely to be a hardware or firmware problem.
I recently rooted my LG Enact, and it has not shut off lately. It is so random that it does not happen often. Seems like if I use 2 or 3 of my optimization tools like CCleaner, and clean master at the same time it can cause it, but not every time.