> Domestic laws of a country do not constitute valid justification for seizing another country's vessels under international law
The great powers (China, Russia and America) have each, at this point, explicitly rejected this principle. More broadly, internationa law does contain broad exemptions for piracy.
UNCLOS provides that “all states have universal jurisdiction on the high seas to seize pirate ships and aircraft, or a ship or aircraft taken by piracy and under the control of pirates, and arrest the persons and seize the property on board” [1].
> if we're using that as a justification, are we admitting the US has turned pirate then?
No, because the seizure was not “committed for private ends by the crew or the passengers of a private ship or a private aircraft” [2]. Under UNCLOS states can’t be pirates.
(Again, this is academic. China has been blowing off UNCLOS judgements in the South China Sea for years.)
This seizure was absolutely legal under the UNCLOS, the US unquestionably has valid justification under international law to seize this (and any other) stateless vessel.