The convention continues, at least among the Marines I've known, but I am Army myself.
"Yes sir" is used when answering a direct question. "Aye/aye aye" is used to acknowledge you have heard a command.
For example:
Lieutenant Butter Bar: Private, did you submit your leave form?
Private Snuffy: Yes, sir.
Vs.
Lieutenant Butter Bar: Private, go to the motor pool and check the trucks.
Private Snuffy: Aye, sir.
"Yes sir" can also be used to acknowledge you've heard orders just like aye, but aye doesn't fit in the reverse. Also, once marine recruits are out of boot camp, they cease calling non-commissioned officers "sir", and instead refer to them by their full rank, ie "Aye, Staff Sergeant" as in the military only officers and warrant officers are called sir. Marine recruits call their NCO instructors "sir" because they are not yet considered Marines and have not yet earned the right to refer to Marine NCOs as such. Once they finish boot camp, they are recognized as Marines.
Hey there! Just letting you know your question is fine here, but you might also want to try it on a military subreddit such as r/usmc or something similar if you don’t get responses here.