Does it shut off suddenly like a switch was turned off or does it sputter? If it shuts off suddenly IMO think "electrical". If sputters, then think "fuel".
My standard answer when there's a car that suddenly shuts off for no apparent reason and then restarts fairly easily is "have you done a through review of the battery and charging system?".
Don't make the mistake of thinking that a bad battery or loose battery cable couldn't possibly cause this problem (it can).
At the least you can begin the real trouble shooting with a known good charging system.
Yes it is like you basically hit a switch or pull a wire that it turns off it turns off my guess it could be a loose ground wire but I shall check all the wiring to the charging system now.
With the car off and resting, push the rear of the car side to side and listen in the fuel tank. Do you hear something metallic inside the tank clanging around? If so, the tank baffle spot welds have broken free and it's causing the car to starve for fuel. This usually happens on hard right turns