Here's a Python implementation to solve the problem:

```
def remove_edges_to_make_tree(n, edges):
    # Create adjacency list
    adj_list = {i: [] for i in range(n)}
    for u, v in edges:
        adj_list[u].append(v)
        adj_list[v].append(u)

    # Check if graph is already a tree
    if len(edges) == n - 1:
        return True

    # Check if graph can be converted into a tree by removing a single edge
    for u, v in edges:
        adj_list[u].remove(v)
        adj_list[v].remove(u)
        visited = [False] * n
        dfs_count = dfs(0, adj_list, visited)
        adj_list[u].append(v)
        adj_list[v].append(u)
        if dfs_count == n:
            return True

    # Check if graph can be converted into a tree by removing two edges
    for u, v in edges:
        adj_list[u].remove(v)
        adj_list[v].remove(u)
        for x, y in edges:
            if x == u and y == v or x == v and y == u:
                continue
            adj_list[x].remove(y)
            adj_list[y].remove(x)
            visited = [False] * n
            dfs_count = dfs(0, adj_list, visited)
            adj_list[x].append(y)
            adj_list[y].append(x)
            if dfs_count == n:
                return True
        adj_list[u].append(v)
        adj_list[v].append(u)

    # Cannot convert graph into a tree by removing up to two edges
    return False


def dfs(node, adj_list, visited):
    visited[node] = True
    count = 1
    for neighbor in adj_list[node]:
        if not visited[neighbor]:
            count += dfs(neighbor, adj_list, visited)
    return count
```

The `remove_edges_to_make_tree` function takes as input the number of vertices `n` and the list of edges `edges` (each edge is represented by a tuple of two vertices). It returns `True` if it is possible to remove up to 2 edges from the graph to obtain a tree that contains at least `n - 2` vertices, and `False` otherwise.

The function first creates an adjacency list representation of the graph using a dictionary. It then checks if the graph is already a tree (i.e., if it has `n-1` edges). If so, it returns `True`. Otherwise, it tries to remove a single edge and check if the resulting graph is a tree by performing a depth-first search (DFS) starting from an arbitrary node. If this is the case, it returns `True`. If not, it tries to remove two edges and check if the resulting graph is a tree in the same way. If a tree is found, it returns `True`. If none of these conditions are met, it returns `False`.

The `dfs` function performs a DFS from a given `node` in the graph represented by the adjacency list `adj_list`. It returns the number of vertices visited during the search. The `visited` list keeps track of which nodes have already been visited to avoid revisiting the same node twice.
Risolvilo usando python: in questo problema, ti viene fornito un grafo non orientato connesso con n vertici e m spigoli. È necessario determinare se è possibile rimuovere fino a 2 spigoli dal grafo per ottenere un albero che contenga almeno n - 2 vertici.