A transformer is a passive instruments, which works on Faraday's law of mutual induction
Faraday's law states that:
Whenever and a magnetic flux linked with a conductor changes an emf is induced in it.
A transformer consists of two electrically isolated coils. one is the primary coil and the other one is secondary coil.