I don't think there is a word for this in standard English.
"Nostalgia" can be used. This is more often a longing to return to a past times that have been experienced, but it is sometimes used, perhaps with an adjective:
This does not lead to a pseudo-romantic nostalgia for the 18th century
Steampunk is nostalgia for a past that never was. (BBC)
The very particular meaning seems not to exist in English, but that doesn't stop people from inventing new words. On a blog Dictionary of Obscure Sorrows the word "anemoia" is proposed for "nostalgia for a time you've never experienced". But be aware that this word has almost no real use, and won't be found in regular dictionaries.
You may be best using a more general word, like "yearning".
He yearns to be a cowboy in the Wild West.