How to extend Customizer payload sent when ‘Save & Publish’ is triggered

You can monkeypatch the wp.customize.previewer.query method:

add_action( 'customize_controls_enqueue_scripts', function () {
    wp_add_inline_script( 'customize-controls', '(function ( api ) {
        api.bind( "ready", function () {
            var _query = api.previewer.query;

            api.previewer.query = function () {
                var query = _query.call( this );
                query.foo = "bar";
                return query;
            };
        });
    })( wp.customize );'
    );
});

This will ensure the script runs immediately after customize-controls.js in the markup – note that wp_add_inline_script will wrap your JS within <script /> tags, no need to do it yourself.