How to do encode this target vector containing strings
To answer your first question, I think OneHotEncoder from category_encoders should be up to the job, just set return_df=False to get a numpy array which you could wrap around a sparse matrix. I don't see how that would lead to a memory error unless you were operating in a very limited space.
If that is the case maybe you could simply try LabelEncoder, though this may be a less optimal solution.