A Unifying Framework for Self-consistent Gravitational Lensing and Stellar Dynamics Analyses of Early-Type Galaxies