Your tenant rights exist for the term of your contract regardless of who owns the property. That is unless you default on the lease agreement which gives the owner the right to evict you.
If you really like the place you rent and are in a position to buy, you could consider contacting th the lender that sent the Notice of Trustee's Sale and discuss purchasing the property. Usually they want to sell the property for the loan balance plus any fees such as loan late fees, legal costs etc.
If you do not get anywhere with the Lender, contact the property owner (your landlord) and ask if they would be willing to sell the property to you. You would have one of two options:
Option #1: Prepare a purchase agreement and have the owner submit it to the lender for a short sale.
Option #2: If you cannot get a bank loan (poor credit, do not have 20% downpayment), you could purchase the property on a land contract. Your downpayment would be the amount owed to the lender to stop the foreclosure process. Then you use the LC payment to pay on the mortgage. After 3 - 5 years you should have enough equity and a stronger credit rating to apply for a loan.
Simon Campbell - http://www.bankforeclosuressale.com