Anisotropic generalization of well-known solutions describing relativistic self-gravitating fluid systems: an algorithm