Linked minds procs each time an Ultron Sentry attacks or is attacked by a hero, including counter attacks. When not attacking a generalist it only creates a class ability if it's a counter class, for example a blaster attacking a bruiser. When attacking a generalist it does a random roll for each class power. Also each sentry present will separately do the roll simultaneously each time it triggers.
This random roll may give it 0 class powers or it may give it all 5. It does a random probability for each class separately. The odds, per class, seem to be ~25%.
For an example: You have a generalist agent, Constrictor(tactician), and Iron Fist(scrapper), facing an infiltrator, blaster, and bruiser sentry.
An infiltrator Sentry attacks Constrictor, it's Constrictor's counter class, so it gets it's class bonus which it shares with the others.
If it was to attack the Agent, each of the Sentrys would do a random roll for 0-5 class powers. A potential outcome: infiltrator Sentry gets Scrapper and Blaster, bruiser gets infiltrator only, blaster gets blaster, tactician, and bruiser.
If the agent was to counter attack at this point the random roll would be triggered again, for EACH counterattack.
Fortunately, the bruiser class bonus is the only one that stacks, because this can get ugly really fast.