I would check the ground strap from the engine to the chassis.
The path from ground to battery is not all that good through bearings and rubber engine mounts, you can get a ground through all the little grounded doo dads, but it is not enough and at some point, if that ground strap is not installed will burn up some sensor ground leads/ECU, etc. way to tell:
next time it does it, use jumper cable between alternator bracket or some other ENGINE part to ground to and hook other end to ground terminal on the battery!
If that cures it, get a new ground strap or make sure the old one is hooked up!

Good Luck!