MistaT hey. Open-play xG is calculated at point of contact based on your situation, eg distance to goal, angle to goal, defensive coverage, body part, preferred foot, passage of play, type of play etc.
There is also post shot xG or xGOT which then takes all that information plus where in the goal frame the ball ended up (specifically for on-target shots)