I’ve never thought about it as training really but I do a lot of thinking about race situations as @DaveWh describes.
I do this regarding physical things - for me in triathlon it might be how I’m going to approach different parts of the race. Transitions particularly which I run through in the days before and a few minutes before actually arriving in transition during the race.
I also go through responses to feelings, how I’m going to react 4 hours into the bike ride when I’m fatiguing and have had enough. Generally there’s a particular part of the course, a hill or incline late in the course where it’s easy to switch off as the going gets tough and I make sure to think about everybody else going backwards and me embracing the challenge.
Similarly in long distance racing I have specific trigger points where it’s time to refocus. IFor example, n my mind everything up to halfway through the marathon is just a warm up. There aren’t many still ‘racing’ by that point and that’s the time to shine! For me I know it’s going to hurt, but I’m the one looking forward to that moment and wanting it to happen. Obviously it’s all N=1 stuff but I’m pretty sure that how I mentally view those times and moments can improve my races by reframing them in positive way.
I’ve never really thought of it as training though. Just something I might think about while staring at nothing in particular on the trainer, while out running or while enjoying a cup of coffee on the sofa in the lead up to a race.