It's against avian physiology to fly somewhere to poo.
If you observe birds in the wild or even your own birds, you'll notice that they usually poo then fly. This is because a dropping is excess weight: even fractions of a gram makes a difference when a tiny budgie is trying to get its weight as low as possible.
Everything about flighted birds' physiology is optimised for flight and they carry no excess weight - their bones are hollow with struts to get the best balance between lightness and strength, the shafts of their feathers are hollow, they are rarely fat (unless in captivity). Jettisonning the excess weight before takeoff is part of that optimisation. A dropping is literally waste and it makes no sense to carry it with them.
As such, you're unlikely to teach a bird to fly somewhere else to poo. Attempting to teach a bird to poo on command can lead to the bird holding onto droppings if the command is not given, or suffering prolapse if the command is given when they don't need to go. These may be rare occurrences but in my opinion, the risk isn't worth it.
It's better to modify the environment to make poo less of an issue. Birds are usually fairly predictable about where they defecate, and it's easy enough to put a couple of sheets of newspaper, tile or vinyl flooring under their perches - these can be disposed of or easily cleaned. There are products like Poop-Off which are very effective for dried droppings. I usually have a sheet of toilet roll and wipe up droppings as they happen.
You can often tell when a bird is about to poo because they do a little shuffle: if your bird does that when on you, you can quickly ask them to step up and take them somewhere else. I would avoid a prompt word or giving treats for this. The bird may learn that poo gets a reward and attempt to pass droppings when they don't need to in order to get more treats: this can be harmful to them.