Practice riding one handed out of the saddle. It’s easier to do while climbing than on flats.
Shifting becomes just a thing to occupy your free hand while either flowing one handed or stomping one handed. Same with signalling traffic or removing/replacing your water bottle.