My answer will begin with assuming you don't really know cross validation.
Do cross validation, there are many ways of doing so. The simplest form is to split your data into training and testing set, let's say with 80:20 proportion. Train your model using the 80% and let it predict the unknown 20%.
If prediction on the unknown 20% (testing set) is far worse/inaccurate than prediction on the 80% (training set), then you know your model is unable to generalize (it overfits).
Do this procedure for each of model specification you want to assess, and see how they compare to one another. In your case, you may want to try adding terms sequentially starting from $x$, then $x^2$, then $x^3$, and so on.
You can take this further and split your data into five "fold"s. Do the above procedure five times, each using different fold of data as the testing set.
Rather than doing this procedure manually, there are packages in R that can do it for you. Package
caret comes to mind, although there may be other packages.
However, as far as I know, there is no procedure to automatically determine whether overfitting happens in an already estimated model.