The vessel was hit by cargo steamship SS Darro in thick fog, off the Isle of Wight, on 21 February 1917.
The South African Native Labour Corps troops onboard were travelling to France to assist the allies during World War One.
A ceremony was held earlier at Hollybrook Cemetery in Southampton.
The Princess Royal's husband, Vice Admiral Sir Timothy Lawrence, accompanied her to the service.
During his speech, on behalf of the War Graves Commission, he paid tribute to the "dignity and bravery" of those who died.
Bodies were washed up along the Sussex coast and buried in graveyards near Brighton, in Littlehampton, East Dean and Hastings.
Princess Anne has attended a memorial ceremony for more than 600 men who died in the sinking of the SS Mendi in the English Channel 100 years ago.