It is in Survival, Escape, Resistance, and Evasion training or SERE. Mostly pilots go through it. The intention is to help the avoid capture, escape if they can, and resist interrogation.
They do a lot of creative things to the students in SERE. Waterboarding is just one of them.