Tracks which teleport is stored in slot #17 of the Portal Nexus. It's set on login and only changes if the slot is changed in the Portal Nexus configuration, at which point varbit 6569 (the interface version) is copied to it.
The values correspond to enum 1377. Note that the values of 150+ (corresponding to switches between e.g. Varrock/Grand Exchange) are not set on this varbit – it will always refer to the base teleport.