If you genuinely want to take boxing seriously I would suggest both a trainer and classes but obviously, as you mentioned, it will cost alot. It’s a difficult call to make because it depends upon a few factors, your weight and natural ability being a couple of examples, some people benefit hugely from having a personal trainer while others have enough discipline to commit to training and enough knowledge to understand what their training should focus on. Something else to be contemplated is that while a class led by a good instructor will not cost too much a good trainer is generally very expensive (not forgetting that they also commonly develop more thorough training schemes meaning more hours of training/extra costs). My suggestion ultimately would be to firstly take some classes to get a basic idea of boxing (and to confirm that you have a genuine interest in the sport) then once that’s done to try a few one-off sessions with various trainers to gather whether there is anything significant they can offer you. If so then you may have to rethink some financial plans or attempt to do without.