A transformer is an electrical device that transfers electrical energy between two or more circuits through electromagnetic induction. It is primarily used to increase (step-up) or decrease (step-down) voltage levels while maintaining the same frequency, which makes it crucial for efficient power transmission and distribution across long distances.