This is When Heaven Fell (1995) by William Barton.

The Wikipedia plot summary covers several of the points you mentioned, noting that...
- The Earth has been conquered by a galaxy-spanning alien empire known as the 'Master Race.'
- The best of Earth's survivors -- including the protagonist, Athol Morrison -- have been recruited into the aliens' army.
- After serving in the aliens' army for 20 years, Athol reconnects with his childhood girlfriend, Alix, who is now working with human rebels.
- Athol is asked to join the rebels, and helps to train them, but ultimately betrays them to the local government to ensure Alix's safety.
- Athol helps the Master Race defeat another alien race known as the Hu.
- The Master Race have multiple slave races working for them, who've been plotting a rebellion of their own.
- The Master Race are believed to have been driven out of the Andromeda Galaxy by another foe.
Earth has been taken over by the Master Race, a galaxy-spanning empire of artificial intelligences, and the best of Earth’s survivors are recruited into the aliens' army. Athol Morrison has served for 20 years, and heads back to Earth for a brief vacation. There, he runs into old friends, and finds it easy to give into his old feelings with his childhood girlfriend, Alexandra (Alix) Moreno.
Alix and the rest of Athol’s friends are involved in a rebellion against Earth’s Master. They ask Athol to help and to join them, and so he helps to train them. Concerned that any rebellion will provoke a genocidal response from the Masters, he betrays the rebellion to the local government, making sure that Alix and Davy Intäke are spared.
Conflicted about what he has done, but feeling as if there was no choice, Athol rejoins up with his new command. Soon afterward comes war with the Hu, the most advanced race yet encountered—they developed hyperspace travel either on their own or stole it from a Master facility. Despite the Hu winning a series of early victories, the Master Race grinds the Hu down in a near-genocidal campaign that leaves the Hu homeworld in ruins.
After that war is over, Athol and one of his concubines visit his alien comrade Shrêhht on her home planet. There, he is invited into another rebellion, one composed of all of the slave races, that has been plotting against the Master Race for over 100,000 years. He returns to Earth a second time and learns that he and Alix have a daughter, Kaye Moreno, and takes her off-planet to be trained as a soldier herself.
Later, the Master Race's empire is attacked by a new foe that the conspirators believe drove the Master Race out of the Andromeda Galaxy and has arrived to finish them off. Athol, now a general, and Kaye ponder whether now would be the right time for the conspirators to revolt against the Master Race and welcome the newcomers, although he worries that if the Masters fall, the subject races will be the "slaves of slaves" forever.
This review notes that Athol's school sweetheart didn't make it through the entrance exams for the masters war academy:
A young boy at the time of the invasion, Athol Morrison joins the masters war academy and rises through the ranks to powerful commands in the masters service enjoying the perks that come with service like human pleasure "servants" and such; on a return leave to Earth some twenty years later, he wants to find his school sweetheart who did not make it through the academy entrance exams, while visiting his family which is not that happy to see him, especially that his brother resents the masters more and more.
The novel is available to read at the Internet Archive.