What is the primary function of a transformer in an electrical circuit?
A. To convert mechanical energy into electrical energy
B. To convert direct current (DC) into alternating current (AC)
C. To step up or step down voltage
D. To store electrical energy temporarily