  Ferroelectric materials play a crucial role in a broad range of technologies
due to their unique properties that are deeply connected to the pattern and
behavior of their ferroelectric (FE) domains. Chief among them, barium titanate
(BaTiO$_3$; BTO) sees widespread applications such as in electronics but
equally is a ferroelectric model system for fundamental research, e.g., to
study the interplay of such FE domains, the domain walls (DWs), and their
macroscopic properties, owed to BTO's multiple and experimentally accessible
phase transitions. Here, we employ Second Harmonic Generation Microscopy (SHGM)
to $\it{in-situ}$ investigate the cubic-to-tetragonal (at $\sim$126$^\circ$C)
and the tetragonal-to-orthorhombic (at $\sim$5$^\circ$C) phase transition in
single-crystalline BTO via 3-dimensional (3D) DW mapping. We demonstrate that
SHGM imaging provides the direct visualization of FE domain switching as well
as the domain dynamics in 3D, shedding light on the interplay of the domain
structure and the phase transition. These results allow us to extract the
different transition temperatures locally, to unveil the hysteresis behavior,
and to determine the type of phase transition at play (1st/2nd order) from the
recorded SHGM data. The capabilities of SHGM in uncovering these crucial
phenomena can easily be applied to other ferroelectrics to provide new
possibilities for $\it{in-situ}$ engineering of advanced ferroic devices.
