Linear parametric state-space models are a ubiquitous tool for analyzing neural time series data, providing a way to characterize the underlying brain dynamics with much greater statistical efficiency than non-parametric data analysis approaches. However, neural time series data are frequently non-stationary, exhibiting rapid changes in dynamics, with transient activity that is often the key feature of interest in the data. Stationary methods can be adapted to time-varying scenarios by employing fixed-duration windows under an assumption of quasi-stationarity. But time-varying dynamics can be explicitly modeled by switching state-space models, i.e., by using a pool of state-space models with different properties selected by a probabilistic switching process. Unfortunately, unlike linear state-space models, exact solutions for state inference and parameter learning with switching state-space models are intractable. Here we derive a solution to the inference problem for a general probabilistic switching state-space framework based on a variational approximation on the joint posterior distribution of the underlying states and the switching process. We then use this state-inference solution within a generalized expectation-maximization (EM) algorithm to learn the model parameters of the linear state-space models and the switching process. We perform extensive simulations in different settings to benchmark the performance of our method against existing switching inference methods. We also demonstrate the robustness of our switching inference to characterize dynamics outside the generative switching model class. In addition, we introduce a novel initialization strategy for the expectation step of the generalized EM algorithm using a leave-one-out strategy to compare among candidate models, which significantly improves performance compared to existing switching methods that employ deterministic annealing. Finally, we demonstrate the utility of our method for the problem of sleep spindle detection, showing how switching state-space models can be used to detect and extract transient spindles from human sleep electroencephalograms in an unsupervised manner.