Can't think of a single thing to see in Tracy. Yosemite is about 4 hours away - you'd have to take Greyhound or a private charter, but I don't know if any private charters stop in Tracy. Greyhound does stop in Tracy, here's their website:
San Francisco is fairly close (comparatively speaking) by bus and certainly worth seeing - very accessible once you're there and you could go more than once from Tracy (that's what I would do).
To get to Yosemite, you'll have to use the YARTS transportation system after getting yourself from Tracy to Fresno...someone who knows more about YARTS will probably come along soon.
But get familiar with Greyhound fares and schedules.