Which (if any at all) of the following two understandings of お世話になりました is correct?
- The implicit subject is あなた. The お〜になります pattern is a 敬語 construction. The full sentence in plain form is あなたが（私の）世話をした, literally meaning "you took care of me".
- The implicit subject is 私. There is nothing special about the なりました part. It just means "became". The full sentence would be 私が世話になりました, literally meaning "I became 世話".
And what about ご馳走になりました？