Hello billcouch,
Thanks for asking the Apple Support Communities for help with macOS restarting.
1. You mention that the computer came with macOS Mojave 10.14, but was erased and had macOS High Sierra 10.13 installed. This may be the cause of the problem: Use the Mac operating system that came with your Mac, or a compatible newer version - Apple Support
2. You can erase your Mac and reinstall macOS Mojave 10.14 or a newer compatible macOS and test if the issues no longer occur: How to reinstall macOS - Apple Support
3. If necessary, check for your compatible version here: How to get old versions of macOS - Apple Support
4. You can also start by checking the troubleshooting provided in this help article: If your Mac restarted because of a problem - Apple Support
Even if you are not receiving any alert or error messages, there are many great troubleshooting steps within this article that apply to your situation, and can help isolate the problem between software and hardware.
5. You can also check this article for more hardware diagnostics and troubleshooting using this article: Diagnose problems with your Mac - Apple Support
6. If this occurs with sleep/wake, please check this article: If your Mac won't go to or stay in sleep - Apple Support
Thanks and have a wonderful day.