Engineering Schottky-to-Ohmic contact transition for 2D metal–semiconductor junctions