You can find that characterization (even with n = 3), as well as the generalization to $\kappa$-complete ultrafilters, in: Fred Galvin and Alfred Horn, Operations preserving all equivalence relations, Proc. Amer. Math. Soc. 24 (1970), 521-523.
This is the correct citation now. Apologies for garbling it on my first try. Additional apologies for repeated edits. I'll go quietly now.