Identifying factor model shifts in different periods

Given a set of K independent variables X = (x1, x2, ..., xk) and a dependent variables y, I try to run the step-wise regression models to find the best set of variables to describe y. The length of total data points is n, so the size of y is n x 1, while that of X is n x k. For example, the best set of variables could be x1, x3, x6 if k = 10, so that model could be y = 0.25 * x1 + 0.30 * x3 + 0.50 * x6 + e.

While the model works using the full data points (n), I sometimes want to look at how y is related to the independent variables in different subset of times, because during a sub-period, x1, x3, x6 may not be the best model. For example, let n = 60, so the first date is Sept 2015 and the last date is Aug 2020. I want to know if the best set of factors changes during, say Sept 2015 to Aug 2018 or Aug 2018 to Aug 2020.

I want to know what algorithms are out there for this kind of problem.

Thanks.