It is done by further observing that the kilogram is a quantity of mass, which is defined as the ratio between the net force on an object and how that object accelerates.
So for example a spring will generally extend from its equilibrium in a manner that depends monotonically on the force on it -- the more it stretches the more force on it. One "canonical" way to measure that two objects have the same mass is therefore:
- Take object 1, attach it to a spring which is attached to a post, and put the whole assembly on a relatively frictionless track. (Use a dashpot to damp the vibrations of the spring, perhaps.)
- Accelerate that post at some reference acceleration $a$ along the frictionless track, and then once the spring has come to a steady length, measure the length $L$ of the spring.
- Stop & reset the apparatus with object 2 attached. Accelerate to the same reference acceleration $a$.
- If the spring comes to the same length $L$, then both objects have the same mass.
(Notice that we do not need Hooke's law that the spring distend linearly with the tension -- we just need the much weaker condition that the distension of the spring from equilibrium is some always-increasing ("monotonic") function of the tension on it.)
However, that means is not used much in practice! This is because we have discovered other laws of nature which help to measure mass.
Here's one way: we've discovered that gravitational forces go proportional to mass, so we now can use a gravity-driven balance to make sure that the two masses balance each other out exactly. Another, used by your bathroom scale: some objects like springs obey Hooke's law, where their force goes linearly with their stretch-length from some equilibrium length: you can therefore measure how much the spring stretches to measure how much weight is hanging from it.
Both of these methods then need to be calibrated to your unit of mass to give the proper result (we need to weigh a known-to-be-100kg weight with the spring to find out how far it goes first, then we can mark 0 and 100 and fill in the middle distances by linearity & geometry). There is a huge assumption therefore that such calibrations are transitive -- when you measure the Official Kilogram in France against two other kilograms, then those other two kilograms will balance each other out and if you balance yet more things against your new two kilograms, those things will balance out the Official Kilogram.
Nevertheless that's the general rule.