How to get "transform.position" from Base Class in realtime

Hi,
i have a Baseclass Player, and three Suclasses (Enemy, Teammate, Keeper). Every Subclass needs to know it’s own unique Position with “transform.position” and the Position from the Baseclass. I found some working solutions like: unique Variables per Class (playerPos, enemyPos, etc.) or static private Variables with the name “position” in all 4 Classes with a get Property.

BUT my question is, is there a Way to declare a non-static protected Variable “position” in the Baseclass which the subclasses can use (derive) for their own Positions? And then to compare the Positions in Realtime (void Update)?.

Example:

public class Player : MonoBehaviour {
            protected Vector3 position;
            
            void Update() {
            Position();
            }
            
            protected Vector3 Position() {
               position = transform.position;
               return position;
               }
            
            }
            
public class Enemy : Player {
               if (base.Position().x == this.Position().x) {
               // Do something
               }
            }

If you want to access a script variable that is not related to an object (instantiation), you must define it as static, no chance to do this any other way.
BUT the major problem is ONLY gameobjects, which are instances, have transforms and therefore positions. Without an instance of those, no position.
The static version would also mean you instantiated only one copy, but then static would be useless, since you instantiate anyway and then you could just read its transform.position directly.

Thank you hexagonius! Now i get it and i am able to do that what i was looking for!