Helper function to gather the transition nodes to be relinked by taking the graph selection into account as well. For example when relinking a transition holding several transition nodes but only a few are selected to be relinked.