WP_Customize_Manager: How to get control ID

I think this is probably not right approach for the way the Customiser is organised.

Controls and Settings are pretty much separate entities. Controls can save settings, but settings aren’t tied to a specific control. As far as I’m aware there’s nothing stopping you having multiple controls for a single setting, for example.

My suggestion would be to abstract the choices into a separate function or variable, and then just reference it in the appropriate places. For example, have this function that defines the valid choices:

function wpse_316500_choices() {
    return [
        'one'   => 'One',
        'two'   => 'Two',
        'three' => 'Three',
    ];
}

And then use that function when registering the control:

$wp_customize->add_control( 'wpse_316500_setting',
    [
        'type'    => 'select',
        'choices' => wpse_316500_get_choices(),
    ]
);

And also in the sanitisation function:

function wpse_316500_sanitize( $input, $setting ) {
    $input = sanitize_key( $input );
    $choices = wpse_316500_get_choices();

    return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
}