Actually the foam is to suppress the oil fire that generally results from a major transformer fire. Most of the really large transformers are oil filled to help with cooling.

It is only an electrical fire until the power is off.