In a climb in VNAV (IAS window closed) it will self transition from IAS to MACH as entered on the FMC climb page
In a climb in LEVEL CHANGE it will transition at around FL260 and it will then climb at M0.69 in the speed window
In a descent in VNAV it will fly the programmed MACH until it reaches the IAS as entered on the FMC descent page. If the IAS is lower than current cruise MACH (slowed down for ATC or using CI20 or less usually) it will reduce thrust and enter a slight descent aiming to be at IDLE and IAS at the same time
In a descent in LEVEL CHANGE it will maintain that speed regardless as it makes its way to the red bricks...