Final Fantasy Ⅵ's
Relm and her ability to
Sketch monsters comes to mind when I think of this - where she imitates one of the enemy monsters' moves by painting them (the monsters) out in thin air.
Even with a deep view of the type chart, moves and lore, there are Pokémon whose abilities are considered magical or supernatural when taken from a Watsonian perspective, in the sense that they are not explained in terms of
other available mechanics and thus to us appear "opaque". Kinda like Ditto's Transform ability being able to copy stats, or how Mold Breaker works, for example. Going by that, taking from the tried and true trope that art imitates life, Smeargle's paint might have a supernatural or magical component to it that allows the Pokémon to infer knowledge or experience about a move and feel it as if it was "first hand". Taking from a
Teen Titans special, I'd go with something like an "ink as blood" or "ink as Lifestream" approach where the ink is living and has an imitative capacity not unlike that of a chameleon's cells, of course amped up in Pokémon style. Smeargle's high proprioception would allow it to acquire information from the paint even after it is interacting with things outside its body (not unlike attacks like Future Sight can interact with users or targets long after cast).
From where, all it remains is for Smeargle to actually be able to
use the move once learned, and for that it's as simple as using the same mechanism, hand-waved or not, that allows Pokémon to use any of their moves they can learn but physiologically speaking they should not be able to. I'm looking at Iron Tail being used by mons without tails, for example.
...And of course, if all else fails, another option is to simply take in such anime asspulls as "Rock Throw works by opening PORTALS IN THE SKY and raining rocks from there"...