I have this game on the series X and frankly at the moment I really wouldn't bother.
For the purpose of context I originally purchased this game on the PlayStation 4 pro on day of release and whilst payable it was never brilliant on that format but the game showed such promise that when the series X came out and I managed to finally get my hands on one of those I thought it was worth purchasing the game again to make use of the extra horsepower from that console.
Whilst some people have had success in multiplayer with smooth frame rates in single player as the game exists at the moment even on the series X I cannot run more than 15 AI cars along with myself without significant stuttering and huge frame rate drops at the start of any race.
For example the first Chicane off the start finish line of Imola if you start from the back of the grid (as I usually do because of the extra challenge) it literally becomes a slideshow during the Chicane during a race, if the AI is sufficient that you can do Close intense racing , effectively so the pack doesn't spread out too much, then again as soon as you get close to a pack of vehicles the framerate starts to tank.
The issue appears to be (amongst other things) the lighting used to project the Shadows seems to have a very heavy impact on the framerate ,prior to the most recent patch if you ran the game on a cloudy day after the first lap it would clear up framerate wise very nicely and it used to be more than agreeable, you could have a good race however post current patch they seem to have nonced this up as well and the frame rates take a hit even on overcast days.
So so to sum up (apologies for the long winded reply) if you're buying a series X for other gaming purposes along with with this game then overtime it may improve and is a good purchase but at the moment I certainly wouldn't go to the expense of purchasing the series X just for this. The game is in a poor state given the power of the X and there appears to be an unwillingness by the developers to make use of the extra horsepower in order to (I suspect) flog you a new version later down the line under the guise of nextgen.