The solution is to implement a system that tracks deaths, allowing you to identify players involved in fights. If you know who are the players who died and who the attackers were, you can link them together. By doing this, system administrators (human or automated admins) can take action against them if they ever become a problem.
To zergers, add more mobs, add environmental hazards, reduce gold and loot drops, and increase respawn times until the group dissipates. If the respawn time is 10 seconds but you have 40 people attacking 1, make their respawn time 60 seconds at least and that's still very mild. Also, if you have the ability to track deaths, then you can track boss deaths too and monitor "boss trains" where people just band up together and nuke bosses around the world.
When you know who killed and who died then people can be grouped through simple battle reports. For example, EVE has multiple community made third-party battle report tools that allow us to analyze groups involved in kills and examine each battle. Here it is one battle report that happened today where we have 22 different groups engaged in a four-way fight:
https://br.evetools.org/br/67276b0a5c49ff0011cd71b7
Letting players handle zerg problems on their own will never work; a system-driven solution is the way to go