I reckon you hit a big bump in the road, the ass end went up, tyres lost traction, your foot made the revs go up so the auto kicked down and thats why it seemed like it kicked out.
Worse thing you did was jump on the brakes. But at least your alright could have ended up worse. I had it happen to me once, I was just cruising 100 km/h on the freeway and because of stiff suspension I hit a bump and the car jumped onto the water. Best thing to do is to do nothing except steer the car. Although if your going sideways well counter steer
EDIT: When I say jumping on the brakes is a bad idea I am referring to aqua plaining as you will lock the wheels up.