How can I converted a linked collection to a local collection?
You can run the command 'Make Duplis Real' which can be found under the F3 key since blender 2.8. However, it works correctly only sometimes. The biggest problem is it breaks parenting of objects in the collection.

The add-on BlenderKit has a command in its panel called 'Bring to Scene', which converts linked collections into appended data also with hierarchy. It's in Blender 2.8 directly in add-ons. It does several steps for you and most of the time makes what you need.