How do I create a transition from a curved surface to a flat surface?
You could start with a cylinder 


add a few loopcuts Ctrl-R 
select the  edge rings to flatten Shift-Alt-RMB
Scale along z-Axis Z




After that could select edges and scale the x-axis: