In this paper we study phase transitions for weakly interacting multiagent systems. By investigating the linear response of a system composed of a finite number of agents, we are able to probe the emergence in the thermodynamic limit of a singular behaviour of the susceptibility. We find clear evidence of the loss of analyticity due to a pole crossing the real axis of frequencies. Such behaviour has a degree of universality, as it does not depend on either the applied forcing nor on the considered observable. We present results relevant for both equilibrium and nonequilibrium phase transitions by studying the Desai-Zwanzig and Bonilla-Casado-Morillo models.