In the rotate transform, the second and third values represent the X and Y coordinates of the center of rotation.
The issue you were facing was that you specified (10, 5) which is far from the actual center of your gear. The correct values should be (97.5, 177.5).
*{
background-color: lime;
}
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 161 231"><defs><style>.cls-1{fill:#fff;}</style></defs><rect class="cls-1" x="3.5" y="3.5" width="154" height="224" rx="8.5" ry="8.5"/>
<path d="M149,7a5,5,0,0,1,5,5V219a5,5,0,0,1-5,5H12a5,5,0,0,1-5-5V12a5,5,0,0,1,5-5H149m0-7H12A12,12,0,0,0,0,12V219a12,12,0,0,0,12,12H149a12,12,0,0,0,12-12V12A12,12,0,0,0,149,0Z"/>
<path d="M134.46,179.67h-2.81a1.08,1.08,0,0,1-.76-1.84l2-2a1.55,1.55,0,0,0,0-2.18l-2.53-2.53a1.58,1.58,0,0,0-2.18,0l-2,2a1,1,0,0,1-.75.32,1.12,1.12,0,0,1-.76-.3,1,1,0,0,1-.33-.78v-2.81a1.55,1.55,0,0,0-1.54-1.54h-3.58a1.55,1.55,0,0,0-1.54,1.54v2.81a1.07,1.07,0,0,1-1.09,1.08,1,1,0,0,1-.75-.32l-2-2a1.58,1.58,0,0,0-2.18,0l-2.53,2.53a1.55,1.55,0,0,0,0,2.18l2,2a1.08,1.08,0,0,1-.76,1.84h-2.81a1.55,1.55,0,0...