David Kimura PRO said about 3 years ago on Dynamic Select Fields :
I would probably start with their event docs. I would probably also use a stimulus controller to wrap select2 and do the logic within there. Sounds like a good follow up episode. https://select2.org/programmatic-control/events