What's plugged into the computer to receive the input from your DX6e? Is it a WS1000 or WS2000 USB dongle?
If so, there are two ways to do it. You can either change it on the transmitter, or you can change the channel mapping in Real Flight. If you're always going to use the same model on the DX6e for RF, then you might want to just change it in the DX6e. If you want to use different models on your DX6e and they already have the same channel for flight mode set up for Switch D, then you could change it in RF.
Before making changes, I'll point out that the default setup for both the DX6e and RF is to use Switch D (Spektrum channel 6 or Aux1 on the DX6e) for flaps. If you want to fly a plane with flaps in the sim, you may wish you had Switch D working that way. That's the "traditional" place to put the flap switch for a real plane. Therefore, I'd suggest using Switch B for flight modes instead, as that's the typical place to put that function.
To change it on the DX6e, go to the System Setup menu and then Channel Assign. On the Channel Input Config screen (select NEXT to get there if Rx Port Assignments comes up first), assign whichever channel is on Switch A (probably Gear) to the switch you want to use as the flight mode switch (B or D).
To change it in RF instead and make it Switch D, go to the Controller Profile (Simulation menu, Select Controller..., and then the "Edit" button). In RealFlight terms, "Channel 8 - Mode" is the flight mode switch. You can click anywhere in the big blue bar to the right of the channel name, and then flip switch D. RF will notice which channel is changing and then assign it for you. It would remove the assignment from flaps and move it to the flight mode control.