It depends what your research area is and how likely it is to attract clearly sustainable external funding, or how willing you are to adapt it to make it sustainably fundable, or how willing you are to work on research where you apply your methodological skills to an area that is related to but not exactly your specific area.
In my experience in the social sciences in the UK, there are two groups of people who have permanent jobs that are predominantly or exclusively focussed on doing research:
1, People who are formally traditional academics, so Lecturers and so on, who earn enough research income to consistently buy themselves out of most teaching.
This can happen in two ways, either people start their careers doing post-docs, fellowships, etc., and by the time they move into a lecturing post they have already built up enough of a reputation with funders to continue to bring in their own funding. The second way is where people have a lecturing post and over time they reduce the amount of teaching they do as they get more able to consistently win funding.
Generally people do some teaching because below Professor level it can cause various problems career-wise if you are employed on a research and teaching contract but don't do any teaching at all.
The way it works with us is that people on Research and Teaching contracts are expected to spend 40% of our time on research, but if we get funding that pays for more than 40% of our time the excess time is taken off our teaching time (theoretically...). If someone employed as a Lecturer/ Assistant Professor wanted to buy out all their teaching time, they would need a personal research income of around £150,000 per year. This is not the value of their research grants as grants include time for other people, post-docs, Co-Is, other collaborators, to conduct research, as well as money for equipment, travel, office costs, etc., it is the amount of funding that is given specifically for that individual to personally spend time conducting the research. As you progress in your career the amount you need to bring in to cover your time increases.
The main problem I have found with taking this route is that departments don't always honour the teaching buy out because it's inconvenient and because the University's workload model allows people to be over-allocated for quite significant periods of time before it's seen as a problem. Basically, this means that you still have to do your teaching but you also have to do the research you have been funded to do, so you are allocated more work to do than you have working days to do it in. Also you have to be working in a very fundable area or have a very established reputation if you want to consistently extend the amount of time that is allocated to you for research and even then you spend significant amounts of time applying for funding.
- People who are employed on Research Only contracts, often in research institutes and centres. Most of the institutes I know of in the social sciences do work in areas that attract a lot of funding from non-academic funders like government departments because their work has some kind of policy or practice relevance, so health, education and skills, various types of business and employment, housing, transport, environment and so on, as this provides them with a sustainable core of reasonably predictable funding. They then supplement this income with more traditional, but also more unpredictable, academic funding from UKRI / ESRC for individual projects or for research centres.
The people in this group usually have permanent contracts if their Institute or Centre is able to demonstrate that their staff collectively bring in enough research income to consistently cover the costs of the Institute and usually to generate a profit that makes them net contributors to the University.
In practice, this means that people work on their specific research area when they have funding to do so but they are expected to pick up other research being conducted in the Institute or Centre to meet their income targets. This might be research that is tangentially related to their specific research area but it might also be 'x project needs someone to conduct some interviews or crunch some data' and the work will be in quite a different research area that nonetheless falls within the remit of the Institute or Centre as a whole.
This I would say is the main problem with taking this route, as depending on the funding environment you could spend lots of time doing research that isn't personally interesting to you and does nothing to help you to progress in your career. Career progression in Research Only jobs is often difficult partly because it benefits the institute when they are bidding for fixed price research to keep their staff cheap, but also because universites don't tend to value research funded by non-academic funders as highly as they do research funded by Research Councils. Also the constant grinding hustle for money, only being able to do research that someone will pay you to do and the level of control some non-academic funders want over the research process and the research findings, the unpredictability of what you might work on, and being out of step with the rhythm of the academic year going on around you are all issues. I worked for a while in a research institute early in my career and while much of the actual work is what I would ideally spend my time doing now, it is by far the most stressful environment I have ever worked in. It might be better in areas like health that tend to have more and larger long-term funding.
People employed in these jobs could do things like PhD supervision (most common), Master's teaching, odd bits of undergraduate teaching, usually because they need to for their career progression, but it isn't a significant part of their job. Sometimes they will have a cap on how much of their time their staff are allowed to spend on teaching, the one I know caps at 10% not including PhD supervision, because unless they are teaching on things like MBAs spending the equivalent time on funded research brings them more money.
If your research isn't in an area that can attract lots of external funding and you don't want to orientate it to that, to have a long-term career in academia mainly doing research you probably have to either go for a traditional lecturing job but aim for a more research intensive university where you will get a decent amount of time to do research alongside teaching (as you work in a new and growing area I would look around for Fellowships to improve your chances of getting a job in this type of university, as there are quite a lot of Fellowships specifically for people working in emerging research areas) or be a career post-doc jumping from post-doc to post-doc getting to do research but never really progressing.
In terms of timing, obviously focus on finishing your PhD, but also try to publish and network as much as you can to establish your reputation. Being known and having people who immediately think of you as a potential collaborator when they are putting in grant proposals is really beneficial, particularly when starting your career but actually throughout it as well. Even if initially it only leads to small amounts of funding as a named researcher rather than as a Co-I or PI, it all helps to build your reputation in your field and with funders.
Also, if you want to try for Fellowships or follow-on funding from your PhD, start researching them now and compile a list of all their deadlines as the deadlines for applications can be months and months ahead of when they would actually start. One of my PhD students is applying for a Fellowship that has an application deadline 8 months before the Fellowship funding would start and preparing the application takes time before that.
If you are not based in a UK university, see if you can find someone who is based in a UK university who would be willing to be an informal mentor to you, maybe someone you meet at a conference who you can then ask based on that initial acquaintance. They will know more about funding and careers in the UK and, provided you don't overburden and annoy them, they will become part of your network of potential collaborators and may introduce you to others. In my subject, being a known associate of someone who is well known is very helpful for your career. Also, make sure you keep up your connection with people in the country where your PhD is based as they can be collaborators that can help you tap into research funding from, including or about that country.