Ask your dog to sit and “stay”. Just lean slightly to the side, away from them, to get them used to you moving your body away from them. Go back to your starting position and reward them. Encourage them to stand up and move around for a short break, and then repeat.
Next, ask your dog to sit and “stay” and this time move one step to the side, then return to your dog and reward them if they have remained sitting down.
Always return to your dog before you reward them. We want them to feel that the position they are staying in is really rewarding, as it always results in you returning and giving them a treat, so they won’t want to move at all! If you give the reward to your dog as you’re going back to them and they get up, you’re actually teaching them that getting up gets them the reward, so they’ll start to get up as soon as you start to return to them! Be careful to reward exactly what you want, which is your dog in the position in which you left them.
Gradually build up how far and in what direction you move. As with building up the duration, we want to be unpredictable, so for example, you might practice moving one step to the side, then two, then one step backwards or on the diagonal, then four steps ahead. This variety teaches your dog that whatever direction you move away from them, they will still only get their treat reward for staying exactly in the position they were in when you said “stay”.