Recently, a new kernel-based approach for identification of time-invariant linear systems has been proposed. Working under a Bayesian framework, the impulse response is modeled as a zero-mean Gaussian vector, with covariance given by the so called stable spline kernel. Such a prior model encodes smoothness and exponential stability information, and depends just on two unknown parameters that can be determined from data via marginal likelihood optimization. It has been shown that this new regularized estimator may outperform classical system identification approaches, such as prediction error methods. This paper extends the stable spline estimator to identification of time-varying linear systems. For this purpose, we include an additional hyperparameter in the model noise, showing that it plays the role of a forgetting factor and can be estimated via marginal likelihood optimization. Numerical experiments show that the new proposed algorithm is able to well track time-varying systems, in particular effectively detecting abrupt changes in the process dynamics.