It was likely the electrical discharge through the nitrogen in the air (guessing arc discharge in this case); it ionizes the nitrogen, which emits blue light when it's subsequently de-ionized.
Yes, when a transformer fails spectacularly like this, there's often an electrical arc for a brief time, which is typically about as bright as lightning.