There is no way to detect when a specific unit type joins or leaves a generals army.
GovernorUnitTrained is the only event that exports both a character record for assigning the trait and a resource_description for the UnitType check, so you could define a FirstCohortCommander trait with a trigger like this:
Code:
Trigger First_cohort_commander
WhenToTest GovernorUnitTrained
Condition UnitType roman legionary first cohort i
and Trait FirstCohortCommander < 1
Affects FirstCohortCommander 1 Chance 100
ps:
type - refers to the specific unit type from EDU
category - infantry, cavalry, siege, non_combatant, ship, handler
unit_class - heavy, light, skirmish, spearmen, missile
mount_class - horse, camel, elephant, chariot
siege_engine_class - tower, ram, ladder, sap_point