You can apply for a transit visa by filling out the application for a Temporary Resident Visa and selecting transit visa from the list of options on the form.
You may not need a transit visa if you are travelling to or from the United States. The Transit Without Visa program (TWOV) and the China Transit Program (CTP) allow certain foreign nationals to transit through Canada on their way to and from the United States without a Canadian transit visa, if they meet certain requirements.