Yes you can apply for the Canada transit visa online via the official portal of IRCC. The steps to apply for a Canada Transit visa are:
Step 1: Create an IRCC account
Step 2: Fill out the visa application form
Step 3: Upload the documents required according to the checklist
Step 4: Submit the biometrics
Step 5: Wait for approval
Step 6: Get your Canada Transit Visa