What is the mechanism of formation of alkali metal superoxide?
Getting to know the superoxide anion radical
Hayyan et al. (2016) have studied and characterized the formation of the superoxide anion radical, $\ce{O2^.-}$. This chemical entity forms as a result of the reduction of diatomic oxygen
$\ce{O2 + e^- -&gt; O2^.-}$
There is some conflicting data on the reactivity of this radical, however it can be isolated:

A few studies have reported that $\ce{O2^.-}$ is relatively reactive. In contrast, a previous study showed that $\ce{O2^.-}$ or hyperoxide, as some scientists name it, is not highly reactive despite being a free radical. The 17-electron $\ce{O2^.-}$ is one of the isolable paramagnetic main-group ions and one of the many intermediate ORR species.

This chemical species can be synthesized in a myriad of ways. It is actually an intermediary in the mitochondrial respiratory chain and it plays a really important role in the activity of respiratory and immune defense systems.

Superoxide can be generated not only enzimatically (as it has been previosuly mentioned), but also electrochemically, photochemically and photocatalitically. Usually, it is either hydrogen peroxide or the peroxy radical used as target-molecules for the synthesis of this species.
Carrying out the synthesis of superoxide photochemically - a mechanism based on solvated electrons
As mentioned earlier, crossing the boundary between diatomic oxygen and superoxide can be done in mutliple ways. Photochemically, this leads to the formation of solvated electrons in the reaction mixture. One electron can attack one oxygen molecule, forming superoxide. Holroyd et al. have concluded in 1978 that photochemical composition of water is the main process leading to the formation of $\ce{e^-(H2O)n}$. The hydroxyl anion $\ce{OH-}$ that forms after the primary dissociation can absorb energy and disproportionate into hydroxyl radical $\ce{OH^.}$ and a solvated electron.
Chemically generating the species
Superoxides of alkali metals have been heavily documented, as well as their synthetic pathways. These alkali cations (such as potassium, sodium and even rubidium and cesium are referred to as superoxide carriers in this context). Zhdanov et al. (2004) have studied the kinetics of synthesis of potassium superoxide. The chemical environment in which this reaction was carried out is alkaline solution of hydrogen peroxide.
$\ce{H2O2 + HO- -&gt; HO2- + H2O}$
Apart from the hydroperoxide species (which involves proton exchange between hydrogen peroxide and the hydroxide species), there has been observed an exchange leading to the formation of an intermediate adduct:

Being a weak acid, hydrogen peroxide enters, under certain conditions, into an exchange reaction with potassium hydroxide to give an intermediate adduct $\ce{K2O2*H2O}$ (potassium peroxide diperoxohydrate).

$\ce{KOH + 3H2O2 -&gt; K2O2*2H2O2 + 2H2O}$
It is this intermediary that disproprotionates upon mild heating into the superoxide species:
$\ce{K2O2*2H2O2 -&gt;[40^o C] 2KO2 + 2H2O}$
This is the most widely used method for obtaining these salts. It is different from the photochemical/electrochemical methods, since the superoxide radical is only generated in situ (if, at all).

Recently, an in situ method was proposed for preparing superoxides by integrating $\ce{H2O2}$ with aqueous $\ce{KOH}$ or sodium hydroxide ($\ce{NaOH}$). $\ce{NaO2}$ was generated by mixing $\ce{NaOH}$ and $\ce{H2O2}$ in aqueous media under ambient conditions (eq 3). $\ce{NaO2}$ is generated by the rapid formation of alkali peroxide, followed by its decomposition in excess $\ce{H2O2}$. However, this method did not provide alkali superoxides in a powder form. By contrast, it was stated that, in this in situ method, $\ce{O2^.-}$ can be generated in solutions for diverse applications.

Conclusions
Two different mechanistic pathways are known for the synthesis of superoxide-based alkali metal salts. One of them involves directly the $\ce{O2^.-}$ species (obtained electrochemically, enzimatically or photochemically) which gets to react with the alkali metal's exposed surface.

Sodium metal, coated in a mixture of superoxide, peroxide, oxide, hydroxide and possibly carbonates
The other mechanism involves the disproportionation of the alkali peroxide-hydrogen peroxide adduct, freeing the superoxide species in the reaction mixture (apologies, but I have found no concrete mechanistic details for this rather bizarre disproportionation).
References

https://en.wikipedia.org/wiki/Sodium_superoxide
Hayyan m., Hashim M.A., Al Nashef I.M., Superoxide Ion: Generation and Chemical Implications, Chem. Rev., 2016, 116 (5), pp 3029–3085.
Sawyer, D. T. Superoxide Chemistry, McGraw-Hill,
D. V. Zhdanov, M. A. Ul’yanova &amp; Yu. A. Ferapontov, A Study of the Kinetics of Synthesis of Potassium Superoxide from an Alkaline Solution of Hydrogen Peroxide, Russian Journal of Applied Chemistry
Richard A. Holroyd and Benon H. J. Bielski, Photochemical Generation of Superoxide Radicals in Aqueous Solutions, Contribution from the Chemistry Department, Brookhaven National Laboratory, Upton, New York 11 973, Received March 9, I978