When was slavery legalized?

It wasn't. It was just made in the 1560's.