I don't think there is a "one-size-fits-all" answer that will work for everyone. I think it's useful to be aware of two extreme scenarios, as well as a few practical considerations. Then you need to decide how to spend your time.
The first extreme is that you narrowly focus only on your research problem. For example, let's say you are computing electroweak loop corrections. You can spend all of your time learning how to use special software to calculate Feynman diagrams, intricacies of the Standard Model, and generally become an expert calculator. If you work hard and are lucky, you may produce several papers in your area. However, you may find it difficult to move into a new area, or to understand the context for what you are working on. By hyperfocusing, you may also not have the feeling of "joy" that comes from satisfying your curiosity and learning new things. On top of this, you may find your knowledge consists of a hodgepodge of unrelated tricks, instead of seeing and understanding interconnections between methods you would get learning things systematically.
The other extreme is that you spend all of your time reading a general book like Weinberg, cover to cover. (And it will take all of your time to read and understand every word in Weinberg). If this goes well, you will be exposed to a lot of topics and you will gain a systematic understanding of the foundations of the field. You will likely be able to understand research papers more quickly and ask better questions. However, you won't be directly solving a research problem and you will not be learning things on the cutting edge, which means you won't be making demonstrable progress toward your PhD. You should also be aware that Weinberg's book in particular is notoriously difficult to learn from. Often people say they use it as a reference, or come to it after they have learned the subject well from another book. There is a real risk of floundering, in the sense of spending a lot of time trying to understand a minute detail in a book, and then in the end discovering it is not really that important, and at the end of your effort you have nothing concrete to show for it.
Of course, you want to avoid these two extremes. Having said that, I think most PhDs are closer to the first extreme, than the second. This isn't necessarily a bad thing. Your goal in a PhD is to become an expert in a narrow domain. That requires intense focus. I also have generally found that having a specific problem to solve will force you to read relevant literature more carefully and understand it more deeply than if you were just browsing that same literature abstractly.
Additionally, there are some practical considerations:
- You may have funding tied to a tight timeline, in which case you will want to prioritize producing work that will lead to a thesis.
- Your advisor may be unhappy with your rate of progress if you spend too much time reading a textbook and not enough on your problem, which may cause friction. Generally minimizing friction with your advisor will make other things easier (such as applying for jobs).
- You may find that you can produce work at a rate your advisor is acceptable with while also doing readings on your own. You might even be more productive, since maintaining a fresh and interesting perspective on your field can keep you motivated and give you fodder for asking questions.
- A common approach is to work simultaneously on two research problems. (You probably don't want to do more than this if you are the person doing the majority of the work and you are just starting out). This kind of naturally forces you away from both of the extremes above, since you will get a breadth of knowledge by having two focus areas, but you'll also avoid being "lost at sea" with nothing to show for it.
What I would probably recommend is establishing the rate at which you need to work to be productive in research and meet (even exceed) your advisor's expectations, and then fill in the remaining work time you have with outside studies.