By definition, employee discounts are for employees, not former employees.
You are not going to get in legal trouble for this, however SHE could be fired. Knowingly giving employee discounts to someone who is not an employee is grounds for immediate termination.
The worst the company could do to you is ban you from the store and/or inform anyone who calls for a reference that you are not eligible for rehire because you requested/accepted the employee discount from your friend a month AFTER you were terminated.
Morally you should have declined, but you are not in any legal trouble. Hope saving $20 was worth looking like a thief to future employers. If I were you, I'd rip up that card and leave this job off your resume.
ETA: "But I din't request for it" Baloney. Handing your discount card to the cashier is the very definition of requesting a discount. You KNEW you were no longer an employee and it also crossed your mind that your friend could get in trouble so obviously you KNEW it was wrong. You did it anyways. You could have very easily declined the discount or at the very minimum asked the cashier to ask a manager. And you know damn well that the manager would have said, "No...someone who hasn't worked here in a month doesn't get the employee discount".
ETA: I specifically said you were not a criminal. I said you were morally in the wrong. (Although I suppose one could make the argument that presenting an employee discount card when you are not an employee is fraud, but now THAT would be dramatic).