Here's what we will end up with. There is a Select2 for a list of Troops, and there is a Primary Troop selected, shown in green, and on a separate line. We can interactively click the Select2 items to toggle the Primary Troop selection.
Following the select we have the display for the Primary selected item. It includes a Hidden form field to carry the selected item's ID, a place to output the Primary item's text, and a container where a message can be displayed if no Primary item is selected.
And now for the Script.
It reads the Primary selected value from the Hidden field to begin, and runs its internal update function then and also when the first item is selected in the Select2, and during other change events. It exposes a destroy method so that dynamic forms can clean up the event handlers.
In the application code, instead of directly calling Select2 now, we call this facade function with an element as the first parameter and any applicable Select2 options second.
Remember, this is using Select2 version 3.5.2. There are breaking changes in version 4.0.0 so this probably is not going to work there.
I welcome your comments, please let me know if you're using the code.