We study the statistics, in stationary conditions, of the work W_{τ} done by the active force in different systems of self-propelled particles in a time τ. We show the existence of a critical value W_{τ}^{†} such that fluctuations with W_{τ}>W_{τ}^{†} correspond to configurations where interaction between particles plays a minor role whereas those with W_{τ}<W_{τ}^{†} represent states with single particles dragged by clusters. This twofold behavior is fully mirrored by the probability distribution P(W_{τ}) of the work, which does not obey the large-deviation principle for W_{τ}<W_{τ}^{†}. This pattern of behavior can be interpreted as due to a phase transition occurring at the level of fluctuating quantities and an order parameter is correspondingly identified.