Monitoring a magnetic state using thermal or electrical activation is mandatory for the development of new magnetic devices, for instance in heat or electrically assisted magnetic recording or room-temperature memory resistor. Compounds such as FeRh, which undergoes a magnetic transition from an antiferromagnetic state to a ferromagnetic state around 100 °C, are thus highly desirable. However, the mechanisms involved in the transition are still under debate. Here we use in situ heating and cooling electron holography to quantitatively map at the nanometre scale the magnetization of a cross-sectional FeRh thin film through the antiferromagnetic–ferromagnetic transition. Our results provide a direct observation of an inhomogeneous spatial distribution of the transition temperature along the growth direction. Most interestingly, a regular spacing of the ferromagnetic domains nucleated upon monitoring of the transition is also observed. Beyond these findings on the fundamental transition mechanisms, our work also brings insights for in operando analysis of magnetic devices.