Often times on oil field ESPs, the transformer is on the OUTPUT side, because the motor is hundreds or maybe thousands of feet down-hole, so they need to boost it to a higher voltage to keep the VD down and the cable weight from being so much that it can't support itself. Going from 480V to 4000V is not unheard of.
I know that a lot of ESP suppliers pay no attention to the step-up transformer design, but I was always taught it was critical because at the variable frequencies, the transformer saturation curve is different. At the very least, the acceptable eddy current loss tolerances should be much tighter, which means top quality silicon steel made for transformers, not recycled Hyundais. I always quoted building them with custom made transformers designed for the variable frequencies, but I usually lost out to the cheap-o guys who didn't care. So if it was the cheapest transformer they could find, it might be that it was just so far off the deep end of being out of tolerance for this use that you ended up with it not working.
But for sure, check your transformer windings with a megger (disconnect the drive!) just like you would the motor. You may have blown through the insulation. A basic off-the-shelf distribution transformer used in this way is subject to the same stresses on the output of the VFD as a motor is; high DV/DT, standing wave generation and corona discharge breakdown of the winding insulation.