Conversion of a transformer into an electromagnet
Just applying DC to a transformer will make a very poor electromagnet, because of the design of the transformer's iron core.

The core is designed to give a continuous loop of iron from one side of the coils to the other.  Rectangular transformers have two loops, giving a squared-off figure of eight.  Toroidal transformers use an iron ring.  Both are designed to keep the magnetism inside the transformer, which makes it more efficient.

But since very little magnetism leaks out, it won't be much use as an electromagnet.