A UK Graduate visa does not lead to settlement, so your stay on a UK Graduate visa is not included into the time that you need to spend in the UK to apply for ILR. You need to switch to a long-term visa for this.
Therefore, after you switch to a new immigration route, e.g. Skilled Worker, you will still have to live and work in the UK for at least five years to get an ILR.
However, your stay on a UK Graduate visa can be included into a 10-year period of required time spent in the UK to obtain an Indefinite Leave to Remain on common grounds.