Derivation of the mechanical and thermodynamic potentials from the generalized BMP model under shear-banding flow