"It wasn't 'criminal'! There was no law on the books against it!" ~ Some random troll
Slavery was criminal, even when it was legal.
Not just because it was against the law in one jurisdiction, but legal in another, but because criminality is not determined solely by what nominal laws are officially "on the books" in a particular jurisdiction, but by ethical principles.
That principle was the entire premise of the Nuremberg trials, and also of the very existence of "international law."