If I get it correct, the current implementation of formations is based purely on the number of players regardless of their class. In reality, keeping formations together was task of officers with the help of NCOs; also, the flag was important as a point around which the soldiers gathered. Hereby an idea to implement realistic function of the leading classes:

for close order formation:
- at least one of the leadership classes (NCO, officer, flag bearer) is needed in order to allow formation buff to switch on, without leadership the formation can be skirmish at most (i.e. close order pack of private soldiers without leadership or flag will still be a "skirmish")
- formation with flag AND officer included will provide even more buffs
- count NCO equivalent of 2 private soldiers
- count officer and flag bearer as 3 private soldiers
(i.e. more leadership means less requirements to set up a formation)
Note: obviously the number of soldiers needed to switch on close order formation buff needs to be adjusted and tweaked


for skirmish formation:
- count NCOs and officers as 2 private soldiers (so one NCO with private close to him will do the skirmish formation)
- count flag as 0 soldiers for skirmish formation (flag bearers were not included in skirmish screens and pickets)