How to make smooth transition lower and higher to flat
The answer to this problem is infallible, albeit extremely tedious: the thorough study of topology.

I'd recommend you start with this blog, a valuable resource.

For this specific situation, two basic rules apply.


quads should be as square as possible
quads should be evenly sized
quads should be evenly distributed


Everything else will produce pinching, which you want but only at the sharp ridge. At that position I will use some rectangles.





Use a (shiny, reflective) matcap with lots of details for previewing.

My topology suggestion is not perfect, at extreme angles the reflections show the disturbance in the underlying structure. It should be improved.