Any time you log out in a sanctuary you start accruing rest XP. It's based on a percentage of a level - not a flat amount of XP - so ideally you want to burn through it on one of your highest level classes so you get the most benefit out of it before switching to any low levels you're still working on.

If it worked the other way around and just gave you a boost for a fixed amount of XP gained, you could just log out for a few hours on a high-level class, switch to a low one and get many, many levels worth of rested XP out of it - having it work on a percentage basis means it's always "level appropriate" even when you switch classes.