  We study the generalized free energy of the dyonic AdS black hole in an
ensemble with varying electric charge $q_E$ and fixed magnetic charge $q_M$.
When we adjust the temperature $T$ and the electric potential $\Phi_E$ of the
ensemble, the Ricci scalar curvature $R$ and electromagnetic potential $A_u$
usually diverge at the horizon. We regularize them and incorporate the
off-shell corrections into the Einstein-Hilbert action. Alternatively, we find
that the off-shell corrections can also be obtained by adding a boundary near
the horizon to exclude the singularities. Ultimately, we derive the generalized
free energy which is consistent with the definition of the thermodynamic
relations. Based on the generalized free energy landscape, we can describe the
dynamics of state transition as a stochastic process quantified by the Langevin
equation. The path integral framework can be formulated to derive the
time-dependent trajectory of the order parameter and the time evolution of the
transition probability. By comparing the probability with the result of the
classical master equation, we attribute the contribution to the probability of
one pseudomolecule or antipseudomolecule (the instanton and anti-instanton
pair) to the rate of state transition. These results are consistent with the
qualitative analysis of the free energy landscape.
