I'm not sure if Ten Hag can solve the problem on Man United defense although he will buy new defenders in January transfer window.
A winter transfer season is not a good one to buy players. Big clubs will not let their best players to move in the winter transfer window so it's nearly impossible to buy best players for a club in this window. Even you can buy a good player, a new player will not have enough time to adapt to a new club, new team mates or even a new league. It is a big difference compares to a summer transfer season because players will have pre-season training to better adapt to a new club.
Cost to buy good player in a winter transfer season usually is more expensive than in the summer too. If it is not like an emergent situation, no need to join the winter transfer.
Ten Hag isn't a typical coach who can choose proper defenders. Many of the the defenders he bought, played underperformance. He also didn't want to sell Maguire even if he knows Maguire is one of the problem in Man United defense. I don't know what Ten Hag thinks to solve Man United problem. He seems have a different view than common managers. Anyway, I assume Man United management also need to evaluate their scouts. Man United scouts look not working very well in the last few years.
Maguire plays better with his national team and we can take it to reconsider about Manchester United defense system. It is a system that is contributed by many players, from defenders to even midfielders and it's unfair to say Maguire is a root cause of all strength or weakness in their defense system. In the match with Copenhagen, it reveals weakness of their system as their midfielders failed to create enough pressure on Copenhagen players. If Copenhagen players can make better distant shots, they even can create more dangerous situations and find goals too.
Not only strengthen the defenders, Onana also needs to improve his performance and avoid unnecessary mistakes. I think Onana also still didn't play consistently, he probably still adapts with Man United players and tactics. But he must adapt quickly because it will bring big impact for Man United if he fail to adapt well. He must be aware that he is Man United main goalkeeper now.
Onana has poor debut for Manchester United but again he is only one player in the squad and defense system. Other players must cover Onana better as no goalkeeper can block all shots from opponents.