I'm just curious as to whether voting for the moderators is anonymous, or can moderators or anyone later see who has voted for whom?
In principle, moderator voting is anonymous except to Stack Exchange developers. Now let me put on my security hat.
All votes are recorded in a database on the Stack Exchange servers. Each ballot has a user ID associated with it. This lets Stack Exchange employees audit vote counts. Barring an unintended data leak, no one other than Stack Exchange developers are able to access the ballot data in the database.
After the election, the set of ballots will be published, without an indication of who cast each ballot. Even the set of voters (vs. abstainers) will not be published.
Moderators do not have any special privilege regarding access to the ballots. Moderators can see in real time the number of people who visited the election page and the number of people who voted (there may be a lag due to caching). In principle, since moderators can also see the last activity date in a user's profile, this could let them correlate last activity times and voting times and guess who cast at least one vote. This would require a lot of data acquisition (probably enough to register as a suspicious access pattern on the Stack Exchange servers), and I doubt the data would be accurate enough to be useful. So I think this data leakage is largely theoretical. In any case, this information would not reveal anything about who the voter voted for.
The only info I was able to find was in "Stack Overflow 2010 Moderator Election Results" post by Jeff Atwood on SO blog:
You can download the Stack Overflow 2010 Moderator Election ballot file and our output result and run the election yourself, if you like. (Of course the individual votes are anonymous in the file)
This is interesting - on one hand, it shows that public voting info is 100% surely anonymous.
OTOH, it explicitly says "in the file", meaning that it does NOT say the moderators won't be able to view this info. I will assume that the voting follows the normal pattern of up/downvoting on SE sites, which is anonymous even from mods:
Like any normal user, votes are anonymous to you and you have no power to alter votes. (source: Moderator Cheat Sheet)
Moderators do not see individual votes anywhere: not on posts and not in elections. We see the same data you see: the ballot file provided at the end of the election.
In general, moderators are given information on a "need to know" basis: there's really no reason why a moderator would ever need to know who you voted for.
I suspect that if a Stack Exchange employee wanted to know, they could figure it out. Aside from everyone else, everyone, moderator, nominee, or just regular member, gets the same information. That information is a downloadable file in which you can see, without names, the first, second, and third choices of everyone who voted. Usually the winners are declared after a few days, but the results are available as soon as the election is done. See this MSO post for how the algorithm works.
If you want to see what the election results look like, take a look at the Gaming's election results. Or any other one, just go to the site, and add election/1 to look at the first one, which is all that most sites have had...