Same way the US won“won“ the vietnam war, just with the enemy beeing even more powerful and better in hiding.
Apart from a lot of air strikes against soft targets there's really no way to win against an enemy that is dispersed through a big terrain.
So either you just bombard every city you can find and just ignore the hidden magicians, or you get them to actually defend those cities, then you can find them. but if they don't care and just go into hiding, laying traps and attacking your army from the distance, you don't win.