It doesn't work on a generator, unfortunately. There has to be a way to create a Celebi wondermail that works, but I don't know enough about Wondermail codes to do that.
It's too bad, because I restarted my game and now I have no way of getting Celebi now that they shut down the WiFi. You used to be able to get it by trading teams.