If you are here on a spouse visa and that relationship has broken down then you are no longer satisfying the criteria of that visa and your extension application is not dependant on the spouse visa or the terms of it so you can apply now, you do not need to wait until 28 days before that expires. You are changing category, not moving up through the same category.
In terms of the indefinite leave to remain, your relationship has broken down so you cannot apply on this basis and there is no automatic route to ILR from when exercising rights of access to a child. You have to first satisfy the requirements of immigration rule 248A:
248A. The requirements to be met by a person seeking leave to remain in the United Kingdom to exercise access rights to a child resident in the United Kingdom are that:
(i) the applicant is the parent of a child who is resident in the United Kingdom; and
(ii) the parent or carer with whom the child permanently resides is resident in the United Kingdom; and
(iii) the applicant produces evidence that he has access rights to the child in the form of:
(a) a Residence Order or a Contact Order granted by a Court in the United Kingdom; or
(b) a certificate issued by a district judge confirming the applicant's intention to maintain contact with the child; or
(c) a statement from the child's other parent (or, if contact is supervised, from the supervisor) that the applicant is maintaining contact with the child; and
(iv) the applicant takes and intends to continue to take an active role in the child's upbringing; and
(v) the child visits or stays with the applicant on a frequent and regular basis and the applicant intends this to continue; and
(vi) the child is under the age of 18; and
(vii) the applicant has limited leave to remain in the United Kingdom as the spouse, civil partner, unmarried partner or same-sex partner of a person present and settled in the United Kingdom who is the other parent of the child; and
(viii) the applicant has not remained in breach of the immigration laws; and
(ix) there will be adequate accommodation for the applicant and any dependants without recourse to public funds in accommodation which the applicant owns or occupies exclusively; and
(x) the applicant will be able to maintain himself and any dependants adequately without recourse to public funds.
If you can do this, you will be given an initial grant of 12 months as per Rule 248B. Once you have completed this 12 months, you can then apply for ILR under Rule 248D but you must have first completed the 12 months.