When current flows through the coil of the transformer, the core of the transformer gets hot. Why?
Transfer of electrical energy from the primary to the secondary is done via a magnetic field (called "flux") and a magnetic circuit called the "core of the transformer." To prevent losses, it is necessary to make sure the whole magnetic field created by the primary passes to the secondary. This is achieved by using an iron core, which has much lower magnetic resistance than air.