Career Advice: The company you work for is NOT your family and you don't owe your job anything beyond the work that you're being paid to do.
Prioritize your own growth and well-being over misplaced loyalty. Companies are not families, they're businesses, it's a business relationship and their goal is to make as much money as they can. If they can make more money by laying you off, they will.
If you ever have an opportunity to better yourself, never feel guilty about taking it.