The task is surprisingly simple, but I'm still not found - you need a system-wide equalizer (interested in both Windows and MacOS) that can apply different presets for the built-in speakers and headphone.
For anybody not a secret that most laptops are very poor sound, and want to somehow fix it, not touching the headphones. Every time you turn on/off manually - no really, thank you!
On Windows it's, like, not such an easy task - it seems to be a wood made so that the system does not know where the sound is inserted headphones or not. But on Mac OS such information available, so I very much hope that the decision will be.
Until I tried Boom 2, Boom 3D eqMac2, Sound control anywhere, this is not possible.