The purpose of the transformer is to increase/decrease voltage. It definitely obeys law of conservation of energy as the increase in voltage is compensated by the decrease in current ( which is generally in the ratio of number of turns in primary and secondary coils). Thus the over all productVI= Constant in both sides of transformer. So input power = power output ( ideal conditions ignoring losses like eddy current loss, hysteresis etc).