tree3 = DecisionTreeRegressor(max_depth=2)

tree3.fit(X, y - tree2_pred)

Fit second decision tree on residuals of current ensemble