The boxes you see around the bases of masts are not generators. They house the control gear for the mast, the back up batteries and a seperate one usually houses the electricity meter (the same as you have at home)
All 'remote' masts have a small dish on them, this a microwave relay link via other nearby sites to a local switching site. These sites usually have a small room attached (about the same size as a small bedroom) with racks of 'krone' connectors, an air conditioner and a burglar/fire alarms. These switching sites are in turn connected to mobile exchanges and to the PSTN using high speed links. When I worked for Orange maintenance it was T-1, 1.5Mbit links but there was't any mobile broadband going on then!
Back-up batteries are installed (usually around enough capacity to keep the remote sites working for up to 24 hrs, and the more central switching sites going for up to 36 hrs.
Wiring for a generator is usually in place so that in the event of a prolonged power failure, a generator can be simply taken to site, plugged in and fired up to run the site and recharge the batteries.
The output power of the site (or rather any particular channel being used at that site) is governed by 2 things - your phone and the sites maximum licensed power output.
If you make a call and during that call you move closer to the site (you might be walking or in a car) the site will say to your phone, via a control channel 'you can reduce your output power because you are getting closer to me' (or it might say the opposite if moving away)
It could request the phone change frequency (it might be detecting some interference) or it could contact another cell(via a switching centre) to say 'get ready to take this call from me' when it sees you moving away from it's coverage area.
This swapping of cells during a call is controlled by a central computer. It tells the new cell what frequency to use and when to take over and it tells your phone (via the control channel of the cell you are currently on) when to switch, what frequency to use and what power output to set itself at, all of which is done so quickly and smoothly that you don't notice (unless you remember the old TACS (analogue) days when you were on the move during a call. It got progressively noisier until finally you heard a chirp and the call was perfectly clear again. You knew you'd just changed cells!
Incidentally, the control channel is always transmitting (it's the one that shows on your phone as signal bars and also delivers your text messages)