Convective self-aggregation refers to a phenomenon in which random convection can self-organize into large-scale clusters over an ocean surface with uniform temperature in cloud-resolving models. Previous literature studies convective aggregation primarily by analyzing vertically integrated (VI) moist static energy (MSE) variance. That is the global MSE variance, including both the local MSE variance at a given altitude and the covariance of MSE anomalies between different altitudes. Here we present a vertically resolved (VR) MSE framework that focuses on the local MSE variance to study convective self-aggregation. Using a cloud-resolving simulation, we show that the development of self-aggregation is associated with an increase of local MSE variance, and that the diabatic and adiabatic generation of the MSE variance is mainly dominated by the boundary layer (BL, the lowest 2 km). The results agree with recent numerical simulation results and the available potential energy analyses showing that the BL plays a key role in the development of self-aggregation. Additionally, we find that the lower free troposphere (2 - 4 km) also generates significant MSE variance in the first 15 days. We further present a detailed comparison between the global and local MSE variance frameworks in their mathematical formulation and diagnostic results, highlighting their differences.