I think it's important not to force yourself to ride at the point where it's not fun anymore. I'm in a similar situation where I'm essentially the only trials rider in my town and travelling to the nearest place takes and hour, and I don't have time for two hours in a train to go for a few hours ride.
One thing I do is I think of making a video. I think of what I would like to see from myself in a video of my riding and I push towards making that video. The problem with this is that, while doing so, I think of new lines so can never decide when 'to quit improving' and make a video. Yet I feel that from this, and I don't want to sound arrogant here, that I am in a constant state of progression. And when I'm in this sort of mindset it tends to continue.
But constantly riding by yourself is hard to do, and much more physically demanding usually. Sometimes when I'm getting depressed about riding I just take a week off where I just don't think about riding, then I'll start when I'm genuinely excited about the thought of riding, and hopefully I'll progress at this point.
Generally though I'd say to watch videos you like, think of some new lines that you can push towards and possibly ride to music if it doesn't distract you.