What do you mean by “Can be any actor?” It is obvious that it can only be the actor that has the State Tree component on it.
Anyway to set component parameters runtime you can check this discussion: How to assign StateTree parameters at runtime - #13 by The-JL
However, since you have your actor in your context you can actually get any component type from it. Moreover, since we established that the actor in the context is “TheActorWithTheStateTree” you can cast to it’s specific type and get all its custom variables and methods as long as they are public.