You should ask where you went wrong at the same time when they tell you this. I'd suggest not to ask it in front of all. You can say like,
Oh, thanks for letting me know. I didn't realize. Can you please tell me where I went wrong? What should I have done instead of this?
You can skip the latter once you're aware of what to do or you have a better idea. If they tell you this and you can improve, then it's all good.
After getting information from them, try correcting your behavior. If you don't follow this, you will not only be making people uncomfortable, but also discouraging other people from explaining things to you in future. Those suggestions may not be pleasant to hear, but we all have to learn how to behave, so take them as a constructive feedback. You can also think about how you should have behaved and then compare it with their suggestions. In this way, you will learn effectively and will not make people uncomfortable in the first place in order to learn.
Remember to not to argue with what you are told or justifying your action because this will also discourage people who are trying to help you improve your social skills.
After been in the same situations for many times, I asked where I went wrong. Their suggestions, not all but most, worked and helped improving my behavior.
I have seen people not learning from their mistakes. I've also seen them saying "but..." and arguing and justifying their actions when someone told them not to behave as such. I'd suggest to avoid this.
If they don't tell you and you have no idea what to do, try reading gesture and reactions of people at the parties next time. This way you will know what to do and what to not. However, I'd advise not to do this in a way you make person in front uncomfortable.