For time series forecasting using machine learning, is feature engineering only needed for the y variable or is it needed for all x variables also? Say I am trying to predict house prices (y variable) using population growth and GDP (x variables) using XGBoost or Neural Networks. All 3 are time series. I understand that I have to feature engineer lags and also a rolling average of house prices and include them as additional features for better prediction. My question is, do i have to do the same (produce lags and rolling averages) for my x variables - GDP and population growth - and include them as additional variables?

You don't have to, but you can. After all, a growing population does not necessarily immediately have an impact on house prices - families with newborns may move into larger houses, but the newborns only generate demands for their own houses a couple of decades later.
As for all predictive situations, be aware that more complex models (e.g., including higher lag orders) will look more sophisticated, but they are not guaranteed to improve predictive accuracy. Thus, use a holdout sample (which for house prices is hard, because there are just so many other influencing factors other than population and GDP).
