I don't think there's a proper way of doing this without having to subclass the subform field and possibly the form class as well. But if your field is "one use only", i.e. you only mean it to be used in a specific form for your own purposes, you could try using Joomla\CMS\Form\Form::getInstance() with the name of the form.
Session variables should be set and redirects performed only by the controller. I assume you already have some controllers in your components. Add the task to an existing one or create a new one, whichever is more appropriate for your component.