Now, before I get jumped on because almost is always an adverb, please allow me to explain.
If almost is an adverb, which it most definitely is (I checked several dictionaries and it is only listed as an adverb), then it must be modifying a verb, or an adjective or another adverb, but its relation is with the noun phrase the size, and really, so it seems, between pods and the size. Adverbs don't modify nouns. It appears to be functioning as a preposition, and indeed about or around, which are true prepositions, would produce equivalent meaning.
The only other option I can see is that almost is modifying the main verb transform which it is not - the flowers do not almost transform, they do indeed transform, so that cannot be the relation.
Ah, come to think of it, there does seem to be one more possibility, namely the demon ellipsis.
These tiny flowers transform into pulp-filled pods (that are) almost the size of rugby balls.
So, its a clause, where almost is modifying the elided verb. I think that's the answer but I still want to hear what folks have to say. Ellipsis seems to be a very strong factor in the evolution of grammar.
Some will say that adverbs can modify noun phrases, and some dictionaries do mention this use as rare but possible (e.g. Cambridge). However, dictionaries are hardly the arbiters of what is grammatical and others do not attribute this function to the adverb class (e.g. Lexico and Dictionary.com. Some sidestep the issue by saying they can modify "phrases". Ha!
It sees a rather bold step to alter the class definition of adverbs with the function of the adjective class, which breaks the distinction, the very usefulness of classes, and seems wrong to me. It seems more fitting to broaden the scope of words, as they evolve in usage, to include another class function, such as almost, which seems to be commonly used as both a preposition and an adjective.
I'm quite stuck with this one. The use is quite common and undeniably well understood. Perhaps this is the language changing again, and it's time to reconsider the scope of this word to include a prepositional function. But maybe someone more knowledgeable than I has a better explanation.