The Generalized Energy Equation and Instability in the Two-layer Barotropic Vortex