It actually began fairly early, and it started for much the same reason that most settlement-colony identities start: because people were born there. By the mid-1700s, there were plenty of third- and fourth-generation heads of household in the western Cape. Although these descendants of various kinds of settlers didn't consider themselves "Africans" in the same quasi-ethnic way we use the term, or even "South Africans" because such a thing didn't exist yet, they did express an distinct identity and it became "African." It was however very much their own, and it overlapped with the specific concept of the trekboer as someone pushing out and taking up new land and forming new communities through their own particular associations [which would be the "why" part]. Non-whites, who were often of mixed heritage, linked to that concept in various ways [some even being "Afrikaner" themselves] but often had their own set of identifiers that were also quite novel (e.g., Griqua, aka Bastaard before the early 1800s). But the term "Afrikaner" is known as early as the first decade of the 1700s in records when a rural Stellenbosch farmer protested Dutch East India Company functionaries' effort to expel him from the colony by insisting on at least one occasion that he was African. Herman Giliomee, historian of Afrikanerdom, describes the instance here in a section from his New History co-authoried with Bernard Mbenga that ruminates over the tangled implications. Travelers in the 18th century referred to Africanders as well, so it certainly was on the rise as a creole identity.
That identity seems to have been predominantly rural in being so connected to the land. The South Africanism that developed in Cape Town and other well-connected urban centers (early Stellenbosch, for example, but not the smaller distant towns like Graaff-Reinet that eventually tried to rebel against them) was somewhat different, and the tension between urban and rural identities didn't abate until well after Union and the codification of Afrikaans (so the 1920s, arguably). The development of urban identities that were "African" is a subtler issue, and I'd argue that they rarely were such--instead they tended to be (say) "Capetonian" for a long time and often still are. Giliomee's own The Afrikaners (2d ed., 2009) is quite good on this matter.
There is a further matter, and that involves "other South Africans," like the Scots, the 1820 settlers, and so forth. Their translation into a South African identity was quieter but also tended to follow this generational motion, even though the later groups tended to retain a stronger connection to metropolitan culture especially if it was from the British isles. John Lambert spent some time with "Englishness" in South Africa and its existence as a liminal identity in the last decade or so; there's a recent book as well by John MacKenzie and Nigel Dalziel on the Scots, which I can't do justice to here but which really explores the layering of self-identification among certain emigre groups. I might add South African Jews to such a consideration, because they've been there since the 1700s too, even when technically prohibited by the Company.
[edit: I fixed a bad verb tense up there, added a note, and modified a sentence to be more strictly correct.]