How does transition of osmoregulation occur in fishes when they migrate from sea to rivers and vice-versa
I found a publication related to the osmoregulation in salmon that might be interesting to you. I'm copying the abstract because it basically answer your question.


  Smoltification, also called parr-smolt transformation, is a complex developmental process that consists of a number of independent, but coordinated changes, in the biochemistry, physiology, morphology and behavior of juvenile salmon in their transition from freshwater to seawater life. A key component of smoltification is represented by the physiological adaptations that enable smolts to thrive in hyperosmotic environments. Instrumental to this process is the ability of smolt gills to gradually become capable of actively secreting salt through specialized cells known as mitochondria-rich (MR) cells, ionocytes or chloride cells. NaCl secretion by teleost gills is therefore accomplished via the secondary active transport of Cl - and the passive transport of Na + . The driving force for active transport is provided by Na + /K + ATPase, which maintains low intracellular Na + and high intracellular K + concentrations. However, this NaCl secretion mechanism needs at least two different ion channels: A CFTR type chloride channel for the passive exit of Cl - and a potassium channel to recycle extracellular K + , which is a thermodynamic prerequisite to work under conditions imposed by high extracellular salinity in seawater. The characteristics of K + channels required for NaCl secretion from MR cells into seawater are still unknown for Salmo salar and only recently have begun to be studied in other teleosts.


You can find the complete paper here.