In my application, I created a form using the collection
field type :
$builder->add(\'tags\', \'collection\', array(
\'type\' => new TagTyp
First thing you should wary about - its that in your scheme if tag become main for one entity it will be main for all entities because the tag store attribute and few entities can be tagged with one tag.
So simplest decision here is to create new property main_tag
near tags in your entity, create hidden field main_tag
(with id to Tag Data transformer) in your form and populate and change this field with jQuery(for example set it on tag click or clear on main tag delete)