It depends.
You may not know if you actually caused a problem for ATC or not.
Did they have to move another airplane as they had a loss of separation? Or was it simply a short stray into Class B?
Are you rated in the airplane? I’m assuming it is a complex airplane?
Do you have your complex endorsements yet?
If yes you have been the ( shared) PIC and if not your CFI is the PIC any default.
That doesn’t completely put you in the clear as you should have known better in the eyes of the FAA but it will make you less guilty and your CFI more. They would definitely want to talk to your CFI also.
If you are an AOPA member get in contact with their legal department.
If not start looking for an aviation attorney.
Do NOT assume the FAA is ever on your side.
Do not volunteer information.
500’ is not that much.
300’ is the allowed max deviation on a transponder.
That plus an incorrect altimeter setting can get you close.
Your instructor should have known better. What were you doing? Chandelles under a Class B?