The purpose of boost serialization is to use references to serialize to an Archive.
Problem is it receives the values as references and not CONST references.
Id const& GetId() const; // Returns a const reference
Try using the following
Id & GetId();
And then one of the following
ar & y.GetId();
ar << y.GetId();
If you don't like the breaking of encapsulation then either use protected, friends, or copy it to another value and pass the value as reference
Id copy = y.GetId();
ar & copy;