The transformer is an static electrical device which transfers electrical energy from one winding to another winding or one electrical circuit to another electrical circuit through the medium of magnetic field without changing its frequency.
It is based on electromagnetic induction principle.

When an alternating current (AC) flows through the primary coil (N1), it generates a varying magnetic field (Magnetic Flux) in the transformer core. The varying magnetic flux induces an alternating voltage in the secondary coil (N2), which can be different from the primary voltage depending upon the number of turns in each coil.
There is no such primary and secondary winging in transformer, the winding which is connected to input supply is termed as primary side or primary coil and the winging from which we get output is termed as secondary winding.
In practically there is two winding in transformer termed as High voltage winding (HV) and Low voltage winding (LV) side.
There is minimum loss of energy, with power is same in both winding and high in efficiency.