The British government has not “broken the law” with the Internal Market Bill.
International law does not apply in the UK in itself. The provisions contained in an international treaty the UK is signatory become law when Parliament passes an Act or Acts that give them effect.
The process for ratification of most treaties is fairly straightforward but a little disconnected. The power to sign treaties lies with the Crown but the Queen doesn’t actually sign them herself, it’s done by British Ministers exercising the Royal Prerogative (powers retained by the Crown which may or may not be devolved to the British government).
Once a treaty is signed it has to be ratified. This is when the UK agrees to be bound by the obligations in the treaty but at this point it is just an agreement between the UK and one or more countries or international organisations, it doesn’t actually change the law. This is where the disconnect is.
For the obligations in the treaty to actually apply to people (or bodies corporate) the British Parliament has to pass an Act of Parliament incorporating them into law. I very specifically say the British Parliament because this is not a power the devolved legislatures have. Only when this domestic legislation comes into force does what the British government signed up to actually become law.
But there is an important distinction to remember here: the treaty itself is not a law, the Act of Parliament is.
Now, the British Parliament has some limited powers in the ratification process. It doesn’t have the power to prevent a treaty from being ratified, for example. Technically. The British government are required to lay all treaties before Parliament for 21 days before ratification. If Parliament refuses to agree to ratification of the treaty the British government is required to make a statement on why they should be able to ratify it anyway. The process then starts all over again, effectively giving Parliament a veto.
The British Parliament is sovereign which, in short, means it can do what it wants. Literally anything. If something is illegal it can pass a law to make it legal. And because Parliament is sovereign it can repeal all or part of any law, even if it means the law no longer reflects treaty obligations. This isn’t illegal, the very act of doing it makes it legal.