  We investigate the off-equilibrium dynamics of a classical spin system with
$O(n)$ symmetry in $2< D <4$ spatial dimensions and in the limit $n\to \infty$.
The system is set up in an ordered equilibrium state is and subsequently driven
out of equilibrium by slowly varying the external magnetic field $h$ across the
transition line $h_c=0$ at fixed temperature $T\leq T_c$. We distinguish the
cases $T = T_c$ where the magnetic transition is continuous and $T<T_c$ where
the transition is discontinuous. In the former case, we apply a standard
Kibble-Zurek approach to describe the non-equilibrium scaling and formally
compute the correlation functions and scaling relations. For the discontinuous
transition we develop a scaling theory which builds on the coherence length
rather than the correlation length since the latter remains finite for all
times. Finally, we derive the off-equilibrium scaling relations for the
hysteresis loop area during a round-trip protocol that takes the system across
its phase transition and back. Remarkably, our results are valid beyond the
large-$n$ limit.
