If you apply the hover to the container it works for both elements.
In the example you provided just change
img:hover {
transform: scale(1.05);
}
to
.wrapper:hover img {
transform: scale(1.05);
}
and hover effect will be working while hovering the text