Smooth operators.
First, it's about having the right concealment gear that fits your chosen weapon
and you.
That means, primarily, a high quality holster, designed with concealment in mind, AND a high quality gun belt, designed specifically to help hold and distribute the weight of the gun (including that added by the holster). They work together.
It always amazes me to watch a guy lay out a $1000 for a quality pistol and then put it into a $20 pancake holster he picked up at the last gunshow, which then rides on his regular dress belt. He's disappointed when it's not comfortable and almost offended when you point out how his piece moves around and/or prints against his cover garmets and is easily detectable, the same as if he'd just screamed "gun!"
In other words, resist the urge to go cheap on your concealment system (i.e., holster + belt).
The second part of it has more to do with attitude: self-confidence in your gear and wearing it enough times with a mix of different seasonal clothing that it becomes, more or less, second nature.
If it's true that "undercover" cops in California (or anywhere else) like to flaunt the fact they're armed, then shame on them. It may impress the homeboys and the little girlies, but if a gallery of "ooohs" and "ahhhs" from displaying their weapon is what they want, they should ask for reassignment to uniform patrol. Clear visibility on the hip throughout the duration of the shift.