2004 Ford Mustang - New battery and loss of electrical - Causatoin or correlation?

Car died while driving loss electrical. Was able to pull over in bank lot wait a few minutes and it stated back. Also I have a new battery.

Could be a faulty crank position sensor. They have a failure mode where they work ok at first, then fail when they get hot. First step as a practical matter is to figure out if the fails to run problem is caused by no spark, or no fuel.

If no CEL, then crank position sensor is likely.
If CEL, then have codes read and post back with the code numbers.

The folks above are likely right, but with me, a new battery and an electrical glitch makes me think bad (loose) ground or power terminal connection. Let us know what you find out.

If the battery cables became disconnected while driving the engine would continue to run… so not likely the problem.