How old are the girls?
Usually, stepparents are not entitled to any parental rights. However, you seem to have a unique situation.
Do you think the bio mother would voluntarily give up her rights to the girls? If so, then the process is quite straightforward. You just need to get her to sign the forms, file them, and go to your hearing.
If she is not open to it, then file your request anyway. She then has the chance to show up to court and argue against it. It is very hard to terminate someone's parental rights. But in this situation, if she is not in the picture because she is in and out of jail, the judge will at least consider it.
As far as you gaining custody, you would then want to adopt the girls after mom loses her rights. Unfortunately, kids cannot have three parents (well a new bill allows this for certain circumstances, but they don't apply here).
It would also help if you and their father were married.
If the girls are old enough, they can be heard by the judge. If they are still pretty young, the court can appoint an evaluator to conduct a little investigation and report his/her findings to the judge. This would include interviewing the kids and everyone else involved.
The court's bottom line is the BEST INTEREST OF THE CHILDREN. So if you operate from that philosophy and can show that it is in their best interest, you stand a pretty good shot.
Because the stakes are so high, I would seek an attorney. If your funds are low you can consult your local bar association to see if they can suggest any pro-bono or low-cost legal representation
You can join in as a party, but I would refrain from doing so without your boyfriend's consent and without need. Unless he is blemished father, it's hard to see how jailbird Mom is going to prevail.
Sign up to receive a 3-part series of useful information and advice about child custody law.