I have exactly this problem. Like some others, I believe my culprit is a large silver maple in the front yard just about in line with the main sewer line out to the street. The first signs of trouble are that the basement toilet bubbles when the upstairs toilet is flushed, because some air is pushed down the drain stack and it can't flow through the main sewer line fast enough. If I wait too long, it progresses to water backing up into the basement shower stall, then draining slowly.
The solution is relatively simple if you're a home handyman. I go to an equipment rental shop - A to Z is one, and some home improvement stores with rental dept's. is another - and rent a ½" diameter sewer snake at least 50 feet ling, with a root-cutter head suitable for the 4" main sewer line. (Head is typically about 2½ to 3" across.) They have both manual ones (you crank the machine by hand) or motorized ones. Although it is more work, I prefer the manual. When I used the motorized one, I found it very difficult to keep the spiral snake under control when it hit a clog and stalled. The snake whipped around in the air quickly before I could shut it off.
Now, you need access to the main sewer line clean-out in the basement so you can get the snake in. And you need leather gloves to handle the snake and crank. I arrange a hose from a water tap to a sewer input (usually the drain pipe for my washing machine) so I can flush water down the line after some clog loosening.
Feed the snake into the sewer clean-out port and start cranking. To get around curves int the pipe, just keep cranking and push the snake gently down the pipe. Once it's going, just cranking it will cause the snake (a metal spiral) to crawl along inside the pipe. Using a thumbscrew to loosen and tighten, you pull a few feet of snake out of its cage, use one hand to control and guide that loop, and crank with the other hand. When it hits a clog the snake head often stalls and twists up. Crank backwards to undo the snarled loops, then grab the snake and pull it back a bit. Now crank again, but hold onto the snake with one hand and pull back a bit to slow it progress so it has time to chew away at the clog. Go back and forth through the clog area a couple times. Once clear, keep going until you think you've got 'em all, or you run out of snake.
This is when I turn on the flush water so the loosened stuff is flushed down the pipe, and the snake is rinsed off as it is pulled out. Now, keep cranking in the same direction, but use one hand to pull the snake back out. The machines I've used have a metal cage to store the snake in and a thumbscrew to tighten. Pull out lengths of snake, stop and loosen the thumbscrew, feed it into the cage, tighten thumbscrew, and repeat until you've got it all back. You will probably find chopped-up tree roots on the head. Flush water through the sewer line. You might want to repeat the entire process if you're not sure you clog the clog cleared. In my case, there's a good test - if I can turn on as much water flow at sinks as possible, then flush the upstairs toilet with no bubbling happening at the basement toilet, I've removed enough roots.
My tree is not going away, so this repeats about once a year. Each session costs me about $25 in rental of the snake (4 hours) and a couple hours of work, but it's not nearly as expensive as hiring a pro to do it!