My original answer was wrong, so I'll summarise what I've learned from the comments and from researching a bit more, with thanks to Eiríkr Útlendi.
In English, we usually talk about syntactic transitivity, which has to do with whether a direct object is present. “I eat a sandwich” features a transitive verb, but “I eat” is intransitive, because no direct object is present.
In contrast, Japanese has a notion of semantic transitivity. サンドを食べる features a transitive verb, which is still transitive in the sentence 食べる, because the verb affects something else.
It does not seem to me to be particularly important whether a verb is semantically transitive if we are using it with no object or anything else attached. However, knowing whether a verb is transitive is definitely important when it comes to using the correct particles.
We have seen を as a direct object marker, but there are other direct object markers than を, and を is not always a direct object marker. In “A Dictionary of Basic Japanese Grammar” by Makino and Tsutsui, direct object marker を is marked as o¹, while, for example, o² is “a particle which indicates a space in/on/across/through/along which s.o. or s.t. moves”.
Your question seems to be about how to determine whether a verb is transitive or not. It seems to me that this can often be inferred from usage. In サンドを食べる, を is used as o¹, a direct object marker. In 道を歩く, を is not a direct object marker, but rather spatial marker o².
Of course, some ambiguity remains. Which usage of を do we see in マラソンを走る? It's o² according to this answer, but that isn't clear from just looking at the sentence.
Therefore, my best attempt at answering your question is to say that, when one wants to determine the transitivity of a verb, one should take cues from how it is used grammatically in examples such as the above, while consulting the different possible meanings of identically-written particles such as を. “A Dictionary of Basic Japanese Grammar”, which I mentioned above, is useful for this.
Here are some additional resources I found useful: