Energy of generalized line graphs