I was searching the Internet for an answer to how rest exp is calculated and no one appears to know. I did find several links to swtorutils.com which is now a domain for sale.
What I did was write down the time, exp to level, and current rest exp for 3 characters and logged them out in fleet. I just came back and did the same thing and did some calculations.
It turns out that you accrue approximately 0.91%-0.92% of the amount you need to level every hour as rested experience. Many people have reported that the cap of rested exp (the most you can have at one time) is equal to the amount you need to hit the next level irrespective of your progress. In that case, you would reach the cap after about 4.5 days logged out in a cantina or fleet (4 days, 13 hours).
The three characters I used were level 10, 19, and 22. I could do it for a longer period of time, to get a smaller error, but I stopped caring just now.