I ran into a similar problem when trying to write a custom controller for the find query, but with transformResponse not being defined - I assume it’s missing to include some module where this is defined, and I tried this but it didn’t seem to work:
const { transformResponse } = require('@strapi/strapi');
Another thing I found was that I had to modify the service call as follows to make the query work (where blog is the name of my collection type):
const { results, pagination } = await strapi.service('api::blog.blog').find(query);
I agree that a proper sample of customizing a controller in v4 would be most helpful, so far I’ve only had limited success with my trial & error approach to figure it out.