We probe local phase fluctuations of trapped two-dimensional (2D) Bose gases using matter-wave interferometry. This enables us to measure the phase correlation function, which changes from an algebraic to an exponential decay when the system crosses the Berezinskii-Kosterlitz-Thouless (BKT) transition. We identify the transition temperature $T_c$ using the universal critical BKT exponent $eta_c =0.25$ and compare the experimental value of $T_c$ with the estimate based on the critical phase-space density. Furthermore, we measure the local vortex density as a function of the local phase-space density, which shows a scale-invariant behavior following an exponential growth across the transition. Our experimental investigation is supported by Monte Carlo simulations and provides a comprehensive understanding of the BKT transition in a trapped system.