Suburau Legacy 2001 dies as I drove up a hill

I rounded a corner to drive up a short hill and the car just dies. I use the emergency brake and carefully roll backwards to a flat area - luckily no one is behind me. The car starts right up again like nothing happened, although my legs shook like crazy for a bit. I visited the gas station closest to my home and called my mechanic - both said it was a freak accident and let them know if it happens again. I don’t want this to happen again? So much for prevention. Anyone have an idea of what happend?