The primary mode of transmission of Treponema pallidum is through direct contact with a syphilitic sore, commonly during vaginal, anal, or oral sex. Vertical transmission from a pregnant woman to her fetus is also possible, leading to congenital syphilis.