Compare the same expression in two statements.
1. “The lion is sleeping in the forest” — the animal is intended, so the expression is literal.
2. “This soldier is a lion in battle” — the soldier is described through the lion's courage, a figurative use.
The form of the word is unchanged. Classification depends on which meaning the usage indicates, and, if it is transferred, what relationship makes the transfer intelligible.