You make the default sight and put on it, it cost you one steel or something.
Then you take the other gun and you get the option to attach the stored mod.
This only work for the same type of weapons even the ones who looks very much the same as machine pistol and combat rifle or simper and hunting guns.