Solved:
Add the srid argument to transform function. I was considering as
transform(srid)
first argument as srid but should be like this
transform(srid=3857)
class MyModelViewSet(viewsets.ModelViewSet):
queryset = MyModel.objects.all().transform(srid=3857)
serializer_class = MyModelSerializer