Probably the only way to be sure is to request supporting paperwork from the seller. This might be more tricky if done through a store, but if it's a private sale, the previous owner should have it. If they bought it from someone who had it done, should have asked for the supporting paperwork.
That said, the paperwork I received back with my camera after its sensor replacement was somewhat vague and didn't outright state 'sensor replacement' but test photos indicate no more white spots with black halos around them.
Another option might be to contact Leica with the serial number and ask for confirmation. Not sure they will share service history details, but maybe they can provide a simple yes or no.
Ko.Fe.'s point is also very relevant. Only recently with the latest cover glass type is the replacement considered a 'permanent' one.