How does a transistor act as an amplifier considering energy conservation?
The base current in a transistor controls the collector current.  The energy comes from the power supply.  It is not generated within the transistor.