The Secret Key is a special item that lets you change the forms of Rotom. With it, you can transform Rotom into its various alternate shapes: Fan Rotom, Wash Rotom, Heat Rotom, Mow Rotom, and Frost Rotom.
To use it, the Secret Key opens a hidden room in Eterna City where you can switch Rotom's forms. As for obtaining the key itself, it was distributed as an event item—available only through Nintendo Wi-Fi Connection from April 20th through May 12th, and also handed out at Toys "R" Us locations in the U.S., Canada, and Puerto Rico during that window. If you missed the event, keep an eye out for reissues, since these keys have been made available again in later distributions.