You are absolutely right: This is what is called an intergenerational transmission of a problem. Children do learn what they live. You grew up taking in your mother’s unhappiness with your dad as well as her belief that he wasn’t doing a good enough job loving her.
Your problem isn’t your husband. Your problem isn’t low self-esteem. Your problem is that you haven’t been able to free yourself from that early teaching. You are very right to be scared that you will end up lonely and alienated just as she was. I hope that gives you the motivation to do something about it.
You are fortunate, indeed, that you learned from your father as well as your mother. You looked for and found a decent guy who is steadfast, who loves you and who has made a good life with you.
The something you can do is some serious therapy. Therapy can help us correct early teaching. In your case, it can also help you truly appreciate all that you have.
Apparently your negative feelings have been building for years. That tells me that if you could fix this on your own, you would have done it already. I therefore encourage you to seek out a therapist and to do that corrective work. You are right that most women would be very happy with the marriage you are tempted to throw away. Since the problem lies within you, not within the man or the marriage, I doubt very much that you will find anything better.
I wish you well.