At the time of the Revolution, African slavery was legal throughout the British Empire. The Revolution was not fought to avoid the British declaring slavery illegal.
The British did not render slavery illegal for more than 50 years after the Revolution began.
The British made the slave trade illegal in 1807, which the U.S. did in 1808.
It is fake history to claim the US parted from Britain to preserve slavery. Most of the founders thought that slavery would just fade away. They didn't and couldn't foresee the invention of the cotton gin and the fabulous profits Southerners could make selling cotton to British mills.
Interesting side note. Mexico declared slavery illegal in 1829, yet 45 years later, slavers were still going North to raid Indian villages in the US for captives to sell in Mexico.