AC Electromagnet from a transformer
If the transformer sparked it is most likely due to the wires shorting on the core, and they were probably damaged when you reassembled the transformer. Transformer windings are usually covered with a thin enamel on the wires.

If it was something else sparking, you probably did not match the voltages of the core and the required voltage of the air pump and too much voltage was given to the air pump.