You can do it one of two ways:
1. If your form is simple (a few fields), you can add conditional formatting to each field to set it read-only while some field (my:IsEditable) == False. Then when you click the edit button, the field is set to True, and all the form fields magically are editable.
2. If you have a lot of fields, you can create 2 views: a readonly and an edit view. Clicking edit switches to the edit view (using rules or code).