<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_nested_class(self, nested_depth, relation_info):
 """ Define the serializer class for a relational field. """

        class NestedModelPermissionSerializer(ModelPermissionsSerializer):

            """ Default nested class for relation. """

            class Meta:
                model = relation_info.related_model
                depth = nested_depth - 1
                nested_context = self.context
                fields = '__all__'

        return NestedModelPermissionSerializer