At the kind of level you are talking, yes, just riding more will help.
Measure your ride length in hours. Road biking is fairly consisent and you can figure out how hard a ride is looking at climbing and distance (killer head winds excepted). Mtb is more complex. Surface makes a difference (hardpack, gravel, sand, mud) as does the technicality in that there can be no rest on the downs and no real speed boost like you get on the road.
As above, interval style riding will help – attack certian bits, try to get pbs and placings on strava if that is your thing. Sprint up every hill.
Good sleep helps, which may be tricky if you are a shift worker. I’m noticeably slower when I tired from lack of sleep.