In Tai Chi the Yi (mind) leads the Chi (energy).
In other words, when you are doing your form your mind which involves your attention and intention should initiate a movement.
Using this concept avoids the problem of moving from posture to posture aimlessly. And if you move without the Yi leading the Chi then you are not doing Tai Chi.
If your mind does wander which is a natural occurence for beginners – focus on your dan tien. This will allow you to become centred again and also makes it easier for your Yi to lead the Chi.
Try this concept the next time you do your form and let me know how it feels.