From Wiki - Milky Way Idle

The player chooses what xp to prioritize by focusing either directly on damage or having a high MP cost. In most cases they will either maximize the Intelligence or the Magic xp gain. Getting to level 90 intelligence is a huge step in their damage as it unlocks the 4th ability slot.

Should they choose to maximize the Intelligence gain, they need to focus on using the most MP you can, while sustaining the casts and never running out of MP. This is usually done with 1 HP and 2 MP foods. An example could be doing planet combat, meaning multiple monsters from the same planet, with Flame Blast, Fireball, Heal and Toxic Pollen for a decent amount of damage with high MP cost, providing both magic xp and intelligence xp.

At some point for mages, it will become more efficient to switch the Heal for Elemental Affinity. The player should still use the combat simulator to check whether this provides a xp benefit or not, but keep in mind to setup the triggers properly. The focus should be on keeping a high number of kills per hour.

Currently, for Magic xp, this setup simulates the best: Flame Blast, Fireball, Elemental Affinity and Toxic Pollen. An opening setup into Elemental Affinity could be this: 2 HP foods (Spaceberry Cake and Donut) + 1 MP food (Star Fruit Yogurt), with Wisdom, Intelligence and Magic coffee (sim if Magic coffee provides more kills per hour, else Critical coffee is a fine alternative).