A transformer is a basic electrical device used to transfer electrical energy between two or more circuits. It works through the principle of electromagnetic induction, which involves the production of electromagnetic forces (EMF) across a conductor that is exposed to alternating magnetic fields. The purpose of using a transformer is to either increase or decrease the voltage of an alternating current (AC).