When the switch turns off, the stored magnetic field collapses and the energy is transferred to the output of the flyback converter as electric current.
As a result, replacement flyback transformers for almost every set on the market are available through dealers in electronic parts, typically for under $50.
These are robust, purpose-built amplifiers with many application-specific design features such as overcurrent protection and aggressive high-pass filtering for flyback voltage protection.