Unfortunately, there is no short answer to that question. The shortest that I can come up with is to find good models that are done correctly and make your topology follow those models. In your case you could look at the images I posted above showing a good model and build similar structures into your model.
Specifically that line that runs horizontally from the inside of of the thigh to the the outside of the hip should actually run from the inside of the thigh to somewhere close to the iliac crest.
The real answer is that when you can answer these questions you will “understand topology and edge-flow”. Making models that can deform correctly is the primary reason that modelers worry about ‘edge flow’. ‘Edge flow’ is placing your vertices, edges, and faces so that they approximate the form you want and there are defined lines of edges in all the places where the model will bend.
To be able to do that you need to know 2 things. (1) You need an understanding of the anatomy you are modeling. If you have not studied the human body then you don’t have a good understanding of where and how the leg actually bends when somebody moves. If you don’t understand how the body bends then you will not get your edges in the correct places and you will get bad deforms. (2) You need a technical understanding of how to build a mesh so that you can place edges and edge-loops where you want them.
The only way I know of to learn anatomy is to study it. I’ve been doing 2d figure drawing for a few years now so I already have an understanding of human anatomy. Look at lots of pictures of naked people and then draw lots of pictures of naked people and you will be going in the right direction.
For (2), I just watched some “how to model…” videos on YouTube and I got the “Blenderilla” DVD to study how the pros did the technical work of building out these meshes so that the edges landed in the right spots.
The ‘short answer’ (but not really helpful answer) is that your edge flow needs to follow the natural bend points on the body.