loss of power while driving

I was at a stop sign today and the car completely shut off. The stereo was reset to default so I lost all constant power. The car started up after I put it in park and restarted it. I drive train is all new and so is the ignition system. Any ideas what this might be?