Properly speaking, one should form the intention before one gets to the altar…as one is vesting, for example, since one must also form the intention of applying the Mass for the intention for which it is to be offered. As I have said, there have been times when I have had to modify the intention of what I am consecrating at the offertory or even thereafter.
It is remarkable the anomalies one can encounter over decades.
I remember one occasion in particular when I arrived at the altar, with only a young server, and discovered there was no corporal…neither on the chalice nor the credence table nor already upon the altar. I leaned over and asked him to go and get one but he did not know what I was talking about, let alone where it might be found. So, on that occasion, I had to do without and, obviously, modify my intention. At large celebrations I have participated in, the Master of Ceremony will advise of special circumstances involving the elements to be consecrated so that the concelebrating bishops and priests may know how we are to form our intention.
Speaking from the vantage point of years long past, we were taught to form a habitual intention such that, when we approached the altar in sacred vestments to offer the Holy Mass, we intended to offer the sacred mysteries, confect the Eucharist, and to consecrate what was on or above the corporal of the altar. That habitual intention would supply if, for whatever bizarre reason, one did not positively form an explicit intention at the celebration of a particular Mass.