Formulas for generalized principal Lyapunov exponent for parabolic PDEs