Chancroid is primarily transmitted through sexual contact with an infected person. The bacterium enters the skin through small cuts or abrasions during sexual activity, leading to the development of ulcers.