We present a combined experimental and theoretical study of the primary and secondary instabilities in a Kolmogorov-like flow. The experiment uses electromagnetic forcing with an approximately sinusoidal spatial profile to drive a quasi-two-dimensional (Q2D) shear flow in a thin layer of electrolyte suspended on a thin lubricating layer of a dielectric fluid. Theoretical analysis is based on a 2D model (Suri et al. 2014), derived from first principles by depth-averaging the full three-dimensional Navier-Stokes equations. As the strength of the forcing is increased, the Q2D flow in the experiment undergoes a series of bifurcations, which is compared with results from direct numerical simulations of the 2D model. The effects of confinement and the forcing profile are studied by performing simulations that assume spatial periodicity and strictly sinusoidal forcing, as well as simulations with realistic no-slip boundary conditions and an experimentally validated forcing profile. We find that only the simulation subject to physical no-slip boundary conditions and a realistic forcing profile provides close, quantitative agreement with the experiment. Our analysis offers additional validation of the 2D model as well as a demonstration of the importance of properly modelling the forcing and boundary conditions. arXiv:1601.00243v3 [physics.flu-dyn]